Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env 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 # Gets or updates a DumpRenderTree (a nearly headless build of chrome). This is | 7 # Gets or updates a DumpRenderTree (a nearly headless build of chrome). This is |
| 8 # used for running browser tests of client applications. | 8 # used for running browser tests of client applications. |
| 9 | 9 |
| 10 import json | 10 import json |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 298 | 298 |
| 299 def main(): | 299 def main(): |
| 300 parser = optparse.OptionParser(usage='usage: %prog [options] download_name') | 300 parser = optparse.OptionParser(usage='usage: %prog [options] download_name') |
| 301 parser.add_option('-r', '--revision', dest='revision', | 301 parser.add_option('-r', '--revision', dest='revision', |
| 302 help='Desired revision number to retrieve for the SDK. If ' | 302 help='Desired revision number to retrieve for the SDK. If ' |
| 303 'unspecified, retrieve the latest SDK build.', | 303 'unspecified, retrieve the latest SDK build.', |
| 304 action='store', default=None) | 304 action='store', default=None) |
| 305 args, positional = parser.parse_args() | 305 args, positional = parser.parse_args() |
| 306 | 306 |
| 307 if positional[0] == 'dartium': | 307 if positional[0] == 'dartium': |
| 308 if args.revision < 4285: | 308 if args.revision and args.revision < 4285: |
|
vsm
2012/08/20 15:24:45
Consider keeping a table of latest revisions keyed
| |
| 309 return too_early_error() | 309 return too_early_error() |
| 310 get_dartium_revision('Dartium', DARTIUM_DIR, DARTIUM_VERSION, | 310 get_dartium_revision('Dartium', DARTIUM_DIR, DARTIUM_VERSION, |
| 311 DARTIUM_LATEST_PATTERN, DARTIUM_PERMANENT_PATTERN, | 311 DARTIUM_LATEST_PATTERN, DARTIUM_PERMANENT_PATTERN, |
| 312 args.revision) | 312 args.revision) |
| 313 elif positional[0] == 'chromedriver': | 313 elif positional[0] == 'chromedriver': |
| 314 if args.revision < 7823: | 314 if args.revision and args.revision < 7823: |
| 315 return too_early_error() | 315 return too_early_error() |
| 316 get_dartium_revision('chromedriver', CHROMEDRIVER_DIR, CHROMEDRIVER_VERSION, | 316 get_dartium_revision('chromedriver', CHROMEDRIVER_DIR, CHROMEDRIVER_VERSION, |
| 317 CHROMEDRIVER_LATEST_PATTERN, | 317 CHROMEDRIVER_LATEST_PATTERN, |
| 318 CHROMEDRIVER_PERMANENT_PATTERN, args.revision) | 318 CHROMEDRIVER_PERMANENT_PATTERN, args.revision) |
| 319 elif positional[0] == 'sdk': | 319 elif positional[0] == 'sdk': |
| 320 if args.revision < 9761: | 320 if args.revision and args.revision < 9761: |
| 321 return too_early_error() | 321 return too_early_error() |
| 322 get_sdk_revision('sdk', SDK_DIR, SDK_VERSION, SDK_LATEST_PATTERN, | 322 get_sdk_revision('sdk', SDK_DIR, SDK_VERSION, SDK_LATEST_PATTERN, |
| 323 SDK_PERMANENT, args.revision) | 323 SDK_PERMANENT, args.revision) |
| 324 elif positional[0] == 'drt': | 324 elif positional[0] == 'drt': |
| 325 if args.revision < 5342: | 325 if args.revision and args.revision < 5342: |
| 326 return too_early_error() | 326 return too_early_error() |
| 327 get_dartium_revision('DumpRenderTree', DRT_DIR, DRT_VERSION, | 327 get_dartium_revision('DumpRenderTree', DRT_DIR, DRT_VERSION, |
| 328 DRT_LATEST_PATTERN, DRT_PERMANENT_PATTERN, | 328 DRT_LATEST_PATTERN, DRT_PERMANENT_PATTERN, |
| 329 args.revision) | 329 args.revision) |
| 330 else: | 330 else: |
| 331 print ('Please specify the target you wish to download from Google Storage ' | 331 print ('Please specify the target you wish to download from Google Storage ' |
| 332 '("drt", "dartium", "chromedriver", or "sdk")') | 332 '("drt", "dartium", "chromedriver", or "sdk")') |
| 333 | 333 |
| 334 if __name__ == '__main__': | 334 if __name__ == '__main__': |
| 335 sys.exit(main()) | 335 sys.exit(main()) |
| OLD | NEW |