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

Side by Side Diff: upload_to_google_storage.py

Issue 2277513002: Run auto-spell-checker (codespell) on files in depot_tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 3 months 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
« no previous file with comments | « presubmit_canned_checks.py ('k') | 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 """Uploads files to Google Storage content addressed.""" 6 """Uploads files to Google Storage content addressed."""
7 7
8 import hashlib 8 import hashlib
9 import optparse 9 import optparse
10 import os 10 import os
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 (code, 116 (code,
117 'Encountered error on setting metadata on %s\n%s' % 117 'Encountered error on setting metadata on %s\n%s' %
118 (file_url, err))) 118 (file_url, err)))
119 119
120 120
121 def get_targets(args, parser, use_null_terminator): 121 def get_targets(args, parser, use_null_terminator):
122 if not args: 122 if not args:
123 parser.error('Missing target.') 123 parser.error('Missing target.')
124 124
125 if len(args) == 1 and args[0] == '-': 125 if len(args) == 1 and args[0] == '-':
126 # Take stdin as a newline or null seperated list of files. 126 # Take stdin as a newline or null separated list of files.
127 if use_null_terminator: 127 if use_null_terminator:
128 return sys.stdin.read().split('\0') 128 return sys.stdin.read().split('\0')
129 else: 129 else:
130 return sys.stdin.read().splitlines() 130 return sys.stdin.read().splitlines()
131 else: 131 else:
132 return args 132 return args
133 133
134 134
135 def upload_to_google_storage( 135 def upload_to_google_storage(
136 input_filenames, base_url, gsutil, force, 136 input_filenames, base_url, gsutil, force,
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 input_filenames, base_url, gsutil, options.force, options.use_md5, 290 input_filenames, base_url, gsutil, options.force, options.use_md5,
291 options.num_threads, options.skip_hashing, options.gzip) 291 options.num_threads, options.skip_hashing, options.gzip)
292 292
293 293
294 if __name__ == '__main__': 294 if __name__ == '__main__':
295 try: 295 try:
296 sys.exit(main()) 296 sys.exit(main())
297 except KeyboardInterrupt: 297 except KeyboardInterrupt:
298 sys.stderr.write('interrupted\n') 298 sys.stderr.write('interrupted\n')
299 sys.exit(1) 299 sys.exit(1)
OLDNEW
« no previous file with comments | « presubmit_canned_checks.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698