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

Side by Side Diff: download_from_google_storage.py

Issue 759013007: Fixed download_from_google_storage for real. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: try to fix 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 def check_bucket_permissions(base_url, gsutil): 113 def check_bucket_permissions(base_url, gsutil):
114 code, _, ls_err = gsutil.check_call('ls', base_url) 114 code, _, ls_err = gsutil.check_call('ls', base_url)
115 if code != 0: 115 if code != 0:
116 print >> sys.stderr, ls_err 116 print >> sys.stderr, ls_err
117 if code == 403: 117 if code == 403:
118 print >> sys.stderr, 'Got error 403 while authenticating to %s.' % base_url 118 print >> sys.stderr, 'Got error 403 while authenticating to %s.' % base_url
119 print >> sys.stderr, 'Try running "download_from_google_storage --config".' 119 print >> sys.stderr, 'Try running "download_from_google_storage --config".'
120 elif code == 404: 120 elif code == 404:
121 print >> sys.stderr, '%s not found.' % base_url 121 print >> sys.stderr, '%s not found.' % base_url
122 return (base_url, code) 122 return code
123 123
124 124
125 def check_platform(target): 125 def check_platform(target):
126 """Checks if any parent directory of target matches (win|mac|linux).""" 126 """Checks if any parent directory of target matches (win|mac|linux)."""
127 assert os.path.isabs(target) 127 assert os.path.isabs(target)
128 root, target_name = os.path.split(target) 128 root, target_name = os.path.split(target)
129 if not target_name: 129 if not target_name:
130 return None 130 return None
131 if target_name in ('linux', 'mac', 'win'): 131 if target_name in ('linux', 'mac', 'win'):
132 return target_name 132 return target_name
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
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