| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 self.is_buildbot = is_buildbot | 205 self.is_buildbot = is_buildbot |
| 206 | 206 |
| 207 def run(self): | 207 def run(self): |
| 208 print 'Installing Selenium Python Bindings' | 208 print 'Installing Selenium Python Bindings' |
| 209 admin_keyword = '' | 209 admin_keyword = '' |
| 210 python_cmd = 'python' | 210 python_cmd = 'python' |
| 211 if 'win32' not in sys.platform and 'cygwin' not in sys.platform: | 211 if 'win32' not in sys.platform and 'cygwin' not in sys.platform: |
| 212 admin_keyword = 'sudo' | 212 admin_keyword = 'sudo' |
| 213 else: | 213 else: |
| 214 # The python installation is "special" on Windows buildbots. | 214 # The python installation is "special" on Windows buildbots. |
| 215 if is_buildbot: | 215 if self.is_buildbot: |
| 216 python_cmd = os.path.join(find_depot_tools_location(is_buildbot), | 216 python_cmd = os.path.join(find_depot_tools_location(self.is_buildbot), |
| 217 'python-bin', 'python') | 217 'python-bin', 'python') |
| 218 page = urllib2.urlopen(self.SETUPTOOLS_SITE) | 218 page = urllib2.urlopen(self.SETUPTOOLS_SITE) |
| 219 run_cmd('%s %s' % (admin_keyword, python_cmd), page.read()) | 219 run_cmd('%s %s' % (admin_keyword, python_cmd), page.read()) |
| 220 page = urllib2.urlopen(self.PIP_SITE) | 220 page = urllib2.urlopen(self.PIP_SITE) |
| 221 run_cmd('%s %s' % (admin_keyword, python_cmd), page.read()) | 221 run_cmd('%s %s' % (admin_keyword, python_cmd), page.read()) |
| 222 run_cmd('%s pip install -U selenium' % admin_keyword) | 222 run_cmd('%s pip install -U selenium' % admin_keyword) |
| 223 | 223 |
| 224 def main(): | 224 def main(): |
| 225 args = parse_args() | 225 args = parse_args() |
| 226 SeleniumBindingsInstaller(args.buildbot).run() | 226 SeleniumBindingsInstaller(args.buildbot).run() |
| 227 chromedriver_loc = find_depot_tools_location(args.buildbot) | 227 chromedriver_loc = find_depot_tools_location(args.buildbot) |
| 228 if args.path: | 228 if args.path: |
| 229 chromedriver_loc = args.path | 229 chromedriver_loc = args.path |
| 230 GoogleCodeInstaller('chromium', chromedriver_loc, | 230 GoogleCodeInstaller('chromium', chromedriver_loc, |
| 231 lambda x: 'chromedriver_%(os)s_%(version)s.zip' % x).run() | 231 lambda x: 'chromedriver_%(os)s_%(version)s.zip' % x).run() |
| 232 if 'darwin' in sys.platform: | 232 if 'darwin' in sys.platform: |
| 233 GoogleCodeInstaller('selenium', os.path.dirname(os.path.abspath(__file__)), | 233 GoogleCodeInstaller('selenium', os.path.dirname(os.path.abspath(__file__)), |
| 234 lambda x: 'selenium-server-standalone-%(version)s.jar' % x).run() | 234 lambda x: 'selenium-server-standalone-%(version)s.jar' % x).run() |
| 235 | 235 |
| 236 if args.firefox: | 236 if args.firefox: |
| 237 FirefoxInstaller().run() | 237 FirefoxInstaller().run() |
| 238 | 238 |
| 239 if __name__ == '__main__': | 239 if __name__ == '__main__': |
| 240 main() | 240 main() |
| OLD | NEW |