| OLD | NEW |
| 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 """This module contains utilities related to Google Storage manipulations. | 6 """This module contains utilities related to Google Storage manipulations. |
| 7 | 7 |
| 8 TODO(epoger): Make this use google-api-python-client rather than the gsutil | 8 TODO(epoger): Make this use google-api-python-client rather than the gsutil |
| 9 tool. See http://skbug.com/2618 . | 9 tool. See http://skbug.com/2618 . |
| 10 """ | 10 """ |
| 11 | 11 |
| 12 import hashlib | 12 import hashlib |
| 13 import os | 13 import os |
| 14 import posixpath | 14 import posixpath |
| 15 import re | 15 import re |
| 16 import shutil | 16 import shutil |
| 17 import tempfile | 17 import tempfile |
| 18 import time | 18 import time |
| 19 | 19 |
| 20 from py.utils import shell_utils |
| 20 from slave import slave_utils | 21 from slave import slave_utils |
| 21 | 22 |
| 22 import file_utils | 23 import file_utils |
| 23 import shell_utils | |
| 24 | 24 |
| 25 | 25 |
| 26 DEFAULT_DEST_GSBASE = 'gs://chromium-skia-gm' | 26 DEFAULT_DEST_GSBASE = 'gs://chromium-skia-gm' |
| 27 TIMESTAMP_STARTED_FILENAME = 'TIMESTAMP_LAST_UPLOAD_STARTED' | 27 TIMESTAMP_STARTED_FILENAME = 'TIMESTAMP_LAST_UPLOAD_STARTED' |
| 28 TIMESTAMP_COMPLETED_FILENAME = 'TIMESTAMP_LAST_UPLOAD_COMPLETED' | 28 TIMESTAMP_COMPLETED_FILENAME = 'TIMESTAMP_LAST_UPLOAD_COMPLETED' |
| 29 LAST_REBASELINED_BY_FILENAME = 'LAST_REBASELINED_BY' | 29 LAST_REBASELINED_BY_FILENAME = 'LAST_REBASELINED_BY' |
| 30 | 30 |
| 31 FILES_CHUNK = 500 | 31 FILES_CHUNK = 500 |
| 32 BUFSIZE = 64 * 1024 | 32 BUFSIZE = 64 * 1024 |
| 33 | 33 |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 slave_utils.GSUtilCopyFile(filename=timestamp_file, gs_base=gs_base, | 447 slave_utils.GSUtilCopyFile(filename=timestamp_file, gs_base=gs_base, |
| 448 subdir=gs_relative_dir, gs_acl=gs_acl) | 448 subdir=gs_relative_dir, gs_acl=gs_acl) |
| 449 | 449 |
| 450 | 450 |
| 451 def _convert_to_posixpath(localpath): | 451 def _convert_to_posixpath(localpath): |
| 452 """Convert localpath to posix format.""" | 452 """Convert localpath to posix format.""" |
| 453 if os.sep == '/': | 453 if os.sep == '/': |
| 454 return localpath | 454 return localpath |
| 455 else: | 455 else: |
| 456 return '/'.join(localpath.split(os.sep)) | 456 return '/'.join(localpath.split(os.sep)) |
| OLD | NEW |