# HG changeset patch # User Jeff Hammel # Date 1296835867 28800 # Node ID 45da31ae738e2356653296a7629f274f9e49b6cf # Parent 5f188d2a36aab20389e30e6a2dc27073c422d991 unzip and get path of firefox on windows diff -r 5f188d2a36aa -r 45da31ae738e autobot/process/factory.py --- a/autobot/process/factory.py Wed Feb 02 18:17:07 2011 -0800 +++ b/autobot/process/factory.py Fri Feb 04 08:11:07 2011 -0800 @@ -62,20 +62,31 @@ # three cases: # - linux has firefox in a .tar.bz2 file + # - windows has firefox in a .zip file # - mac has firefox in a .dmg file [TODO] - # - windows has firefox in a .zip file if platform['os'] == 'linux': self.addStep(ShellCommand(command=['tar', 'xjvf', WithProperties('%(firefox_bundle)s')], haltOnFailure=True )) self.addStep(SetProperty(property='firefox', - command=['python', '-c', - 'import os; print os.path.abspath("firefox/firefox")'])) - + command=self.abspath('firefox/firefox'))) + elif platform['os'] == 'win': + self.addStep(ShellCommand(command=['unzip', WithProperties('%(firefox_bundle)s')], + haltOnFailure=True)) + self.addStep(SetProperty(property='firefox', + command=self.abspath('firefox/firefox.exe')) else: + # TODO: mac raise NotImplementedError("FirefoxDownloader doesn't know how to work with your os: %s" % platform['os']) + def abspath(self, path): + """returns a command that will print the absolute path""" + # TODO: could use WirthProperties if needed + # could also go not in a class, again if needed + return ['python', '-c', + 'import os; print os.path.abspath("%s")' % path] + class SourceFactory(BuildFactory): """