Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(484)

Unified Diff: infra/bots/common.py

Issue 2167763002: Add "skp" asset (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Backpedal: Don't get rid of old SKPs yet Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « infra/bots/assets/skp/upload.py ('k') | infra/bots/download_skps.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/bots/common.py
diff --git a/infra/bots/common.py b/infra/bots/common.py
deleted file mode 100644
index 3c4a85d163a71918a5d9649c24ca0b48be0f943f..0000000000000000000000000000000000000000
--- a/infra/bots/common.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2016 Google Inc.
-#
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-import os
-import shutil
-import subprocess
-
-
-GS_GM_BUCKET = 'chromium-skia-gm'
-
-GS_SUBDIR_TMPL_SKP = 'playback_%s/skps'
-
-VERSION_FILE_SKP = 'SKP_VERSION'
-
-
-def download_dir(skia_dir, tmp_dir, version_file, gs_path_tmpl, dst_dir):
- # Ensure that the tmp_dir exists.
- if not os.path.isdir(tmp_dir):
- os.makedirs(tmp_dir)
-
- # Get the expected version.
- with open(os.path.join(skia_dir, version_file)) as f:
- expected_version = f.read().rstrip()
-
- print 'Expected %s = %s' % (version_file, expected_version)
-
- # Get the actually-downloaded version, if we have one.
- actual_version_file = os.path.join(tmp_dir, version_file)
- try:
- with open(actual_version_file) as f:
- actual_version = f.read().rstrip()
- except IOError:
- actual_version = -1
-
- print 'Actual %s = %s' % (version_file, actual_version)
-
- # If we don't have the desired version, download it.
- if actual_version != expected_version:
- if actual_version != -1:
- os.remove(actual_version_file)
- if os.path.isdir(dst_dir):
- shutil.rmtree(dst_dir)
- os.makedirs(dst_dir)
- gs_path = 'gs://%s/%s/*' % (GS_GM_BUCKET, gs_path_tmpl % expected_version)
- print 'Downloading from %s' % gs_path
- subprocess.check_call(['gsutil', 'cp', '-R', gs_path, dst_dir])
- with open(actual_version_file, 'w') as f:
- f.write(expected_version)
« no previous file with comments | « infra/bots/assets/skp/upload.py ('k') | infra/bots/download_skps.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698