Index: slave/skia_slave_scripts/download_skimage_files.py |
diff --git a/slave/skia_slave_scripts/download_skimage_files.py b/slave/skia_slave_scripts/download_skimage_files.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..22e46b469e6b0c4fbb355acfde5105b4e85f0d5f |
--- /dev/null |
+++ b/slave/skia_slave_scripts/download_skimage_files.py |
@@ -0,0 +1,37 @@ |
+#!/usr/bin/env python |
+# Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+""" Download the image files needed to run skimage tool. """ |
+ |
+from build_step import BuildStep |
+from utils import gs_utils |
+from utils import sync_bucket_subdir |
+import os |
+import sys |
+ |
+class DownloadSKImageFiles(BuildStep): |
+ def __init__(self, timeout=12800, no_output_timeout=9600, **kwargs): |
+ super (DownloadSKImageFiles, self).__init__(timeout=timeout, |
+ no_output_timeout=no_output_timeout, |
+ **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
|
+ |
+ def _DownloadSKImagesFromStorage(self): |
+ """Copies over image files from Google Storage if the timestamps differ.""" |
+ dest_gsbase = (self._args.get('dest_gsbase') or |
+ sync_bucket_subdir.DEFAULT_PERFDATA_GS_BASE) |
+ print '\n\n========Downloading image files from Google Storage========\n\n' |
+ gs_relative_dir = os.path.join('skimage', 'input') |
+ gs_utils.DownloadDirectoryContentsIfChanged( |
+ gs_base=dest_gsbase, |
+ gs_relative_dir=gs_relative_dir, |
+ local_dir=self._skimage_in_dir) |
+ |
+ def _Run(self): |
+ # Locally copy image files from GoogleStorage. |
+ self._DownloadSKImagesFromStorage() |
+ |
+ |
+if '__main__' == __name__: |
+ sys.exit(BuildStep.RunBuildStep(DownloadSKImageFiles)) |