Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/usr/bin/env python | |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 """ Download the image files needed to run skimage tool. """ | |
| 7 | |
| 8 from build_step import BuildStep | |
| 9 from utils import gs_utils | |
| 10 from utils import sync_bucket_subdir | |
| 11 import os | |
| 12 import sys | |
| 13 | |
| 14 class DownloadSKImageFiles(BuildStep): | |
| 15 def __init__(self, timeout=12800, no_output_timeout=9600, **kwargs): | |
| 16 super (DownloadSKImageFiles, self).__init__(timeout=timeout, | |
| 17 no_output_timeout=no_output_timeout, | |
| 18 **kwargs) | |
|
borenet
2013/06/26 12:54:45
Nit: spacing. If the parameters won't line up wit
scroggo
2013/06/26 15:06:39
This is copied from download_skps.py. Agreed that
| |
| 19 | |
| 20 def _DownloadSKImagesFromStorage(self): | |
| 21 """Copies over image files from Google Storage if the timestamps differ.""" | |
| 22 dest_gsbase = (self._args.get('dest_gsbase') or | |
| 23 sync_bucket_subdir.DEFAULT_PERFDATA_GS_BASE) | |
| 24 print '\n\n========Downloading image files from Google Storage========\n\n' | |
| 25 gs_relative_dir = os.path.join('skimage', 'input') | |
| 26 gs_utils.DownloadDirectoryContentsIfChanged( | |
| 27 gs_base=dest_gsbase, | |
| 28 gs_relative_dir=gs_relative_dir, | |
| 29 local_dir=self._skimage_in_dir) | |
| 30 | |
| 31 def _Run(self): | |
| 32 # Locally copy image files from GoogleStorage. | |
| 33 self._DownloadSKImagesFromStorage() | |
| 34 | |
| 35 | |
| 36 if '__main__' == __name__: | |
| 37 sys.exit(BuildStep.RunBuildStep(DownloadSKImageFiles)) | |
| OLD | NEW |