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

Unified Diff: tools/bots/editor.py

Issue 19523003: Use a utils.TempDir() decorator for temporary files, to make sure we clean up even in case of excep… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « editor/build/build.py ('k') | tools/utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bots/editor.py
diff --git a/tools/bots/editor.py b/tools/bots/editor.py
index 1de749df6c15d10b8f52b592ec315056f1ca199c..cd3a28c6b42ba2494aef1c2e7b94528b43750fe0 100755
--- a/tools/bots/editor.py
+++ b/tools/bots/editor.py
@@ -5,9 +5,7 @@
import os
import re
-import shutil
import sys
-import tempfile
import bot
@@ -20,14 +18,6 @@ GSUTIL = utils.GetBuildbotGSUtilPath()
GCS_DARTIUM_BUCKET = "gs://dartium-archive/continuous"
GCS_EDITOR_BUCKET = "gs://continuous-editor-archive"
-class TempDir(object):
- def __enter__(self):
- self._temp_dir = tempfile.mkdtemp('eclipse-workspace')
- return self._temp_dir
-
- def __exit__(self, *_):
- shutil.rmtree(self._temp_dir, ignore_errors = True)
-
def GetBuildDirectory(mode, arch):
configuration_dir = mode + arch.upper()
build_directory_dict = {
@@ -96,7 +86,7 @@ def CreateAndUploadMacInstaller(arch):
mac_build_dmg_py = os.path.join('tools', 'mac_build_editor_dmg.sh')
editor_dir = GetEditorDirectory('Release', arch)
dart_sdk = GetDartSdkDirectory('Release', arch)
- with TempDir() as temp_dir:
+ with utils.TempDir('eclipse') as temp_dir:
# Get dartium
dartium_directory = DownloadDartium(temp_dir, 'dartium-mac.zip')
dartium_bundle_dir = os.path.join(dartium_directory,
@@ -135,7 +125,7 @@ def main():
for arch in test_architectures:
editor_executable = GetEditorExecutable('Release', arch)
with bot.BuildStep('Test Editor %s' % arch):
- with TempDir() as temp_dir:
+ with utils.TempDir('eclipse') as temp_dir:
args = [editor_executable, '-consoleLog', '--test', '--auto-exit',
'-data', temp_dir]
RunProcess(args)
« no previous file with comments | « editor/build/build.py ('k') | tools/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698