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..abc9910c20a1a68c0e624c35aed994e55c425eae |
--- /dev/null |
+++ b/slave/skia_slave_scripts/download_skimage_files.py |
@@ -0,0 +1,38 @@ |
+#!/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. """ |
epoger
2013/07/08 16:03:05
Wouldn't it be simpler to keep the source image fi
scroggo
2013/07/08 22:36:44
Yes, it would be easier to keep them in resources.
epoger
2013/07/12 15:09:01
I don't know where the line is either. :-) You ge
|
+ |
+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) |
+ |
+ 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)) |