OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
6 | 6 |
7 # Run to install the necessary components to run webdriver on the buildbots or | 7 # Run to install the necessary components to run webdriver on the buildbots or |
8 # on your local machine. | 8 # on your local machine. |
9 # Note: The setup steps can be done fairly easily by hand. This script is | 9 # Note: The setup steps can be done fairly easily by hand. This script is |
10 # intended to simply and reduce the time for setup since there are a fair number | 10 # intended to simply and reduce the time for setup since there are a fair number |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 return os_str | 150 return os_str |
151 | 151 |
152 | 152 |
153 class FirefoxInstaller(object): | 153 class FirefoxInstaller(object): |
154 """Installs the latest version of Firefox on the machine.""" | 154 """Installs the latest version of Firefox on the machine.""" |
155 | 155 |
156 def ff_download_site(self, os_name): | 156 def ff_download_site(self, os_name): |
157 return 'http://releases.mozilla.org/pub/mozilla.org/firefox/releases/' + \ | 157 return 'http://releases.mozilla.org/pub/mozilla.org/firefox/releases/' + \ |
158 'latest/%s/en-US/' % os_name | 158 'latest/%s/en-US/' % os_name |
159 | 159 |
160 @property | |
Siggi Cherem (dart-lang)
2012/04/13 18:19:48
do you believe in magic? and I hope you do!
| |
160 def get_os_str(self): | 161 def get_os_str(self): |
161 """Returns the string that Mozilla uses to denote which operating system a | 162 """Returns the string that Mozilla uses to denote which operating system a |
162 Firefox binary is for.""" | 163 Firefox binary is for.""" |
163 os_str = ('win32', '.exe') | 164 os_str = ('win32', '.exe') |
164 if 'darwin' in sys.platform: | 165 if 'darwin' in sys.platform: |
165 os_str = ('mac', '.dmg') | 166 os_str = ('mac', '.dmg') |
166 elif 'linux' in sys.platform: | 167 elif 'linux' in sys.platform: |
167 os_str = ('linux-i686', '.tar.bz2') | 168 os_str = ('linux-i686', '.tar.bz2') |
168 if '64bit' in platform.architecture()[0]: | 169 if '64bit' in platform.architecture()[0]: |
169 os_str = ('linux-x86_64', '.tar.bz2') | 170 os_str = ('linux-x86_64', '.tar.bz2') |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
232 lambda x: 'chromedriver_%(os)s_%(version)s.zip' % x).run() | 233 lambda x: 'chromedriver_%(os)s_%(version)s.zip' % x).run() |
233 if 'darwin' in sys.platform: | 234 if 'darwin' in sys.platform: |
234 GoogleCodeInstaller('selenium', os.path.dirname(os.path.abspath(__file__)), | 235 GoogleCodeInstaller('selenium', os.path.dirname(os.path.abspath(__file__)), |
235 lambda x: 'selenium-server-standalone-%(version)s.jar' % x).run() | 236 lambda x: 'selenium-server-standalone-%(version)s.jar' % x).run() |
236 | 237 |
237 if args.firefox: | 238 if args.firefox: |
238 FirefoxInstaller().run() | 239 FirefoxInstaller().run() |
239 | 240 |
240 if __name__ == '__main__': | 241 if __name__ == '__main__': |
241 main() | 242 main() |
OLD | NEW |