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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 return loc | 66 return loc |
67 raise Exception("Could not find depot_tools in your path.") | 67 raise Exception("Could not find depot_tools in your path.") |
68 | 68 |
69 | 69 |
70 class GoogleCodeInstaller(object): | 70 class GoogleCodeInstaller(object): |
71 """Install code that is being hosted on Google Code.""" | 71 """Install code that is being hosted on Google Code.""" |
72 | 72 |
73 def __init__(self, project_name, download_location, download_name_func): | 73 def __init__(self, project_name, download_location, download_name_func): |
74 """ Create a object that will install code from a Google Code site. | 74 """ Create a object that will install code from a Google Code site. |
75 Arguments: | 75 Arguments: |
76 project_name - The GoogleCode project name such as "selenium" or "chromium." | 76 project_name - The GoogleCode project name such as "selenium" or |
| 77 "chromedriver." |
77 download_location - Where to download the desired file on our filesystem. | 78 download_location - Where to download the desired file on our filesystem. |
78 download_name_func - A function that takes a dictionary (currently with keys | 79 download_name_func - A function that takes a dictionary (currently with keys |
79 "os" and "version", but more can be added) that calculates the string | 80 "os" and "version", but more can be added) that calculates the string |
80 representing the name of the download we want. | 81 representing the name of the download we want. |
81 """ | 82 """ |
82 self.project_name = project_name | 83 self.project_name = project_name |
83 self.download_location = download_location | 84 self.download_location = download_location |
84 self.download_name_func = download_name_func | 85 self.download_name_func = download_name_func |
85 self.download_regex_str = self.download_name_func({'os': self.get_os_str, | 86 self.download_regex_str = self.download_name_func({'os': self.get_os_str, |
86 'version': '.+'}) | 87 'version': '.+'}) |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 page = urllib2.urlopen(self.PIP_SITE) | 221 page = urllib2.urlopen(self.PIP_SITE) |
221 run_cmd('%s %s' % (admin_keyword, python_cmd), page.read()) | 222 run_cmd('%s %s' % (admin_keyword, python_cmd), page.read()) |
222 run_cmd('%s pip install -U selenium' % admin_keyword) | 223 run_cmd('%s pip install -U selenium' % admin_keyword) |
223 | 224 |
224 def main(): | 225 def main(): |
225 args = parse_args() | 226 args = parse_args() |
226 SeleniumBindingsInstaller(args.buildbot).run() | 227 SeleniumBindingsInstaller(args.buildbot).run() |
227 chromedriver_loc = find_depot_tools_location(args.buildbot) | 228 chromedriver_loc = find_depot_tools_location(args.buildbot) |
228 if args.path: | 229 if args.path: |
229 chromedriver_loc = args.path | 230 chromedriver_loc = args.path |
230 GoogleCodeInstaller('chromium', chromedriver_loc, | 231 GoogleCodeInstaller('chromedriver', chromedriver_loc, |
231 lambda x: 'chromedriver_%(os)s_%(version)s.zip' % x).run() | 232 lambda x: 'chromedriver_%(os)s_%(version)s.zip' % x).run() |
232 if 'darwin' in sys.platform: | 233 if 'darwin' in sys.platform: |
233 GoogleCodeInstaller('selenium', os.path.dirname(os.path.abspath(__file__)), | 234 GoogleCodeInstaller('selenium', os.path.dirname(os.path.abspath(__file__)), |
234 lambda x: 'selenium-server-standalone-%(version)s.jar' % x).run() | 235 lambda x: 'selenium-server-standalone-%(version)s.jar' % x).run() |
235 | 236 |
236 if args.firefox: | 237 if args.firefox: |
237 FirefoxInstaller().run() | 238 FirefoxInstaller().run() |
238 | 239 |
239 if __name__ == '__main__': | 240 if __name__ == '__main__': |
240 main() | 241 main() |
OLD | NEW |