| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2014, 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 |
| 11 # of steps. | 11 # of steps. |
| 12 | 12 |
| 13 # TODO(efortuna): Rewrite this script in Dart when the Process module has a | 13 # TODO(efortuna): Rewrite this script in Dart when the Process module has a |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 """The strings to indicate what OS a download is for.""" | 102 """The strings to indicate what OS a download is for.""" |
| 103 os_str = 'win' | 103 os_str = 'win' |
| 104 if 'darwin' in sys.platform: | 104 if 'darwin' in sys.platform: |
| 105 os_str = 'mac' | 105 os_str = 'mac' |
| 106 elif 'linux' in sys.platform: | 106 elif 'linux' in sys.platform: |
| 107 os_str = 'linux32' | 107 os_str = 'linux32' |
| 108 if '64bit' in platform.architecture()[0]: | 108 if '64bit' in platform.architecture()[0]: |
| 109 os_str = 'linux64' | 109 os_str = 'linux64' |
| 110 if self.project_name == 'chromedriver' and ( | 110 if self.project_name == 'chromedriver' and ( |
| 111 os_str == 'mac' or os_str == 'win'): | 111 os_str == 'mac' or os_str == 'win'): |
| 112 os_str = os_str + '32' | 112 os_str += '32' |
| 113 return os_str | 113 return os_str |
| 114 | 114 |
| 115 def run(self): | 115 def run(self): |
| 116 """Download and install the project.""" | 116 """Download and install the project.""" |
| 117 print 'Installing %s' % self.project_name | 117 print 'Installing %s' % self.project_name |
| 118 os_str = self.get_os_str | 118 os_str = self.get_os_str |
| 119 version = self.find_latest_version() | 119 version = self.find_latest_version() |
| 120 download_path = self.download_path_func({'os': os_str, 'version': version}) | 120 download_path = self.download_path_func({'os': os_str, 'version': version}) |
| 121 download_name = os.path.basename(download_path) | 121 download_name = os.path.basename(download_path) |
| 122 urllib.urlretrieve(os.path.join(self.source_path(), download_path), | 122 urllib.urlretrieve(os.path.join(self.source_path(), download_path), |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 if not args.iedriver and platform.system() == 'Windows': | 425 if not args.iedriver and platform.system() == 'Windows': |
| 426 GoogleCodeInstaller('selenium', find_depot_tools_location(args.buildbot), | 426 GoogleCodeInstaller('selenium', find_depot_tools_location(args.buildbot), |
| 427 lambda x: 'IEDriverServer_Win32_%(version)s.zip' % x).run() | 427 lambda x: 'IEDriverServer_Win32_%(version)s.zip' % x).run() |
| 428 if not args.firefox: | 428 if not args.firefox: |
| 429 FirefoxInstaller().run() | 429 FirefoxInstaller().run() |
| 430 if not args.opera: | 430 if not args.opera: |
| 431 OperaInstaller().run() | 431 OperaInstaller().run() |
| 432 | 432 |
| 433 if __name__ == '__main__': | 433 if __name__ == '__main__': |
| 434 main() | 434 main() |
| OLD | NEW |