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

Unified Diff: tools/utils.py

Issue 28773003: Changes to annotated step scripts: dart-editor-installer-* builders will build installer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « tools/mac_build_editor_dmg.sh ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/utils.py
diff --git a/tools/utils.py b/tools/utils.py
index a81c7e6749093c47d25acbe5246a4c9bab33ed11..88339302846a8f6b81a922377c44a00a73d68164 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -462,6 +462,19 @@ class TempDir(object):
def __exit__(self, *_):
shutil.rmtree(self._temp_dir, ignore_errors=True)
+class ChangedWorkingDirectory(object):
+ def __init__(self, working_directory):
+ self._working_directory = working_directory
+
+ def __enter__(self):
+ self._old_cwd = os.getcwd()
+ print "Enter directory = ", self._working_directory
+ os.chdir(self._working_directory)
+
+ def __exit__(self, *_):
+ print "Enter directory = ", self._old_cwd
+ os.chdir(self._old_cwd)
+
if __name__ == "__main__":
import sys
« no previous file with comments | « tools/mac_build_editor_dmg.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698