Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Side by Side Diff: download_from_google_storage.py

Issue 780113003: Fix download_from_google_storage.py. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Download files from Google Storage based on SHA1 sums.""" 6 """Download files from Google Storage based on SHA1 sums."""
7 7
8 8
9 import hashlib 9 import hashlib
10 import optparse 10 import optparse
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 # Check if output file already exists. 448 # Check if output file already exists.
449 if not options.directory and not options.force and not options.no_resume: 449 if not options.directory and not options.force and not options.no_resume:
450 if os.path.exists(options.output): 450 if os.path.exists(options.output):
451 parser.error('Output file %s exists and --no_resume is specified.' 451 parser.error('Output file %s exists and --no_resume is specified.'
452 % options.output) 452 % options.output)
453 453
454 base_url = 'gs://%s' % options.bucket 454 base_url = 'gs://%s' % options.bucket
455 455
456 # Check we have a valid bucket with valid permissions. 456 # Check we have a valid bucket with valid permissions.
457 if not options.no_auth: 457 if not options.no_auth:
458 code = check_bucket_permissions(base_url, gsutil, options.no_auth) 458 code = check_bucket_permissions(base_url, gsutil)
459 if code: 459 if code:
460 return code 460 return code
461 461
462 return download_from_google_storage( 462 return download_from_google_storage(
463 input_filename, base_url, gsutil, options.num_threads, options.directory, 463 input_filename, base_url, gsutil, options.num_threads, options.directory,
464 options.recursive, options.force, options.output, options.ignore_errors, 464 options.recursive, options.force, options.output, options.ignore_errors,
465 options.sha1_file, options.verbose, options.auto_platform) 465 options.sha1_file, options.verbose, options.auto_platform)
466 466
467 467
468 if __name__ == '__main__': 468 if __name__ == '__main__':
469 sys.exit(main(sys.argv)) 469 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698