| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2012, 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 import hashlib | 7 import hashlib |
| 8 import imp | 8 import imp |
| 9 import os | 9 import os |
| 10 import subprocess | 10 import subprocess |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 }[utils.GuessOS()] | 179 }[utils.GuessOS()] |
| 180 env['AWS_CREDENTIAL_FILE'] = boto_config | 180 env['AWS_CREDENTIAL_FILE'] = boto_config |
| 181 env['BOTO_CONFIG'] = boto_config | 181 env['BOTO_CONFIG'] = boto_config |
| 182 | 182 |
| 183 if GSUtil.GSUTIL_IS_SHELL_SCRIPT: | 183 if GSUtil.GSUTIL_IS_SHELL_SCRIPT: |
| 184 gsutil_command = [GSUtil.GSUTIL_PATH] | 184 gsutil_command = [GSUtil.GSUTIL_PATH] |
| 185 else: | 185 else: |
| 186 gsutil_command = [sys.executable, GSUtil.GSUTIL_PATH] | 186 gsutil_command = [sys.executable, GSUtil.GSUTIL_PATH] |
| 187 | 187 |
| 188 run(gsutil_command + gsutil_args, env=env, | 188 run(gsutil_command + gsutil_args, env=env, |
| 189 shell=GSUtil.GSUTIL_IS_SHELL_SCRIPT) | 189 shell=(GSUtil.GSUTIL_IS_SHELL_SCRIPT and sys.platform == 'win32')) |
| 190 | 190 |
| 191 def upload(self, local_path, remote_path, recursive=False, public=False): | 191 def upload(self, local_path, remote_path, recursive=False, public=False): |
| 192 assert remote_path.startswith('gs://') | 192 assert remote_path.startswith('gs://') |
| 193 | 193 |
| 194 args = ['cp'] | 194 args = ['cp'] |
| 195 if public: | 195 if public: |
| 196 args += ['-a', 'public-read'] | 196 args += ['-a', 'public-read'] |
| 197 if recursive: | 197 if recursive: |
| 198 args += ['-R'] | 198 args += ['-R'] |
| 199 args += [local_path, remote_path] | 199 args += [local_path, remote_path] |
| (...skipping 26 matching lines...) Expand all Loading... |
| 226 if not mangled_filename: | 226 if not mangled_filename: |
| 227 mangled_filename = os.path.basename(filename) | 227 mangled_filename = os.path.basename(filename) |
| 228 | 228 |
| 229 checksum = CalculateChecksum(filename) | 229 checksum = CalculateChecksum(filename) |
| 230 checksum_filename = '%s.md5sum' % filename | 230 checksum_filename = '%s.md5sum' % filename |
| 231 | 231 |
| 232 with open(checksum_filename, 'w') as f: | 232 with open(checksum_filename, 'w') as f: |
| 233 f.write('%s *%s' % (checksum, mangled_filename)) | 233 f.write('%s *%s' % (checksum, mangled_filename)) |
| 234 | 234 |
| 235 return checksum_filename | 235 return checksum_filename |
| OLD | NEW |