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

Unified Diff: tools/dartium/download_multivm.py

Issue 305723005: Copy a utility class into download_multivm.py (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dartium/download_multivm.py
diff --git a/tools/dartium/download_multivm.py b/tools/dartium/download_multivm.py
index a95f9f2546f6eaf9c2e8218528e9282d013178f2..0a31bceedd8ed4337db4a67ba9b7730e716c8816 100755
--- a/tools/dartium/download_multivm.py
+++ b/tools/dartium/download_multivm.py
@@ -15,6 +15,7 @@ import platform
import shutil
import subprocess
import sys
+import tempfile
# We are in [checkout dir]/src/dart/tools/dartium in a dartium/multivm checkout
TOOLS_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -27,6 +28,18 @@ else:
if not os.path.exists(GSUTIL):
GSUTIL = 'gsutil'
+class TempDir(object):
+ def __init__(self, prefix=''):
+ self._temp_dir = None
+ self._prefix = prefix
+
+ def __enter__(self):
+ self._temp_dir = tempfile.mkdtemp(self._prefix)
+ return self._temp_dir
+
+ def __exit__(self, *_):
+ shutil.rmtree(self._temp_dir, ignore_errors=True)
+
def ExecuteCommand(cmd):
print 'Executing: ' + ' '.join(cmd)
subprocess.check_output(cmd)
@@ -38,8 +51,7 @@ def main():
.replace('linux', 'lucid64')
.replace('multivm', 'multivm-dartium')
.replace('perf', 'build'))
- utils = imp.load_source('utils', os.path.join(TOOLS_DIR, 'utils.py'))
Bill Hesse 2014/05/28 18:05:34 dart/tools is not checked out into the multivm rep
- with utils.TempDir() as temp_dir:
+ with TempDir() as temp_dir:
archive_file = archive_dir + '-' + revision + '.zip'
gs_source = '/'.join([GS_BUCKET, archive_dir, archive_file])
zip_file = os.path.join(temp_dir, archive_file)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698