OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 import argparse | 6 import argparse |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
11 | 11 |
12 from telemetry.core import command_line | 12 from telemetry.core import command_line |
13 from telemetry.util import cloud_storage | 13 from telemetry.util import cloud_storage |
14 | 14 |
15 | 15 |
16 BUCKET_ALIASES = { | 16 BUCKET_ALIASES = { |
17 'public': cloud_storage.PUBLIC_BUCKET, | 17 'public': cloud_storage.PUBLIC_BUCKET, |
18 'partner': cloud_storage.PARTNER_BUCKET, | 18 'partner': cloud_storage.PARTNER_BUCKET, |
19 'google-only': cloud_storage.INTERNAL_BUCKET, | 19 'internal': cloud_storage.INTERNAL_BUCKET, |
20 } | 20 } |
21 BUCKETS = {bucket: easy_bucket_name for easy_bucket_name, bucket | 21 BUCKETS = {bucket: easy_bucket_name for easy_bucket_name, bucket |
22 in BUCKET_ALIASES.iteritems()} | 22 in BUCKET_ALIASES.iteritems()} |
23 | 23 |
24 | 24 |
25 def _GetPaths(path): | 25 def _GetPaths(path): |
26 root, ext = os.path.splitext(path) | 26 root, ext = os.path.splitext(path) |
27 if ext == '.sha1': | 27 if ext == '.sha1': |
28 file_path = root | 28 file_path = root |
29 hash_path = path | 29 hash_path = path |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 subprocess.call(['git', 'add', hash_path]) | 193 subprocess.call(['git', 'add', hash_path]) |
194 | 194 |
195 | 195 |
196 class CloudStorageCommand(command_line.SubcommandCommand): | 196 class CloudStorageCommand(command_line.SubcommandCommand): |
197 commands = (Ls, Mv, Rm, Upload) | 197 commands = (Ls, Mv, Rm, Upload) |
198 | 198 |
199 | 199 |
200 if __name__ == '__main__': | 200 if __name__ == '__main__': |
201 logging.getLogger().setLevel(logging.INFO) | 201 logging.getLogger().setLevel(logging.INFO) |
202 sys.exit(CloudStorageCommand.main()) | 202 sys.exit(CloudStorageCommand.main()) |
OLD | NEW |