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

Side by Side Diff: tools/android/loading/common_util.py

Issue 1872313002: sandwich: Implement SandwichTaskBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addresses pasko's comments Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 # Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import contextlib 5 import contextlib
6 import json 6 import json
7 import logging 7 import logging
8 import os 8 import os
9 import re 9 import re
10 import shutil 10 import shutil
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 @contextlib.contextmanager 82 @contextlib.contextmanager
83 def TemporaryDirectory(): 83 def TemporaryDirectory():
84 """Returns a freshly-created directory that gets automatically deleted after 84 """Returns a freshly-created directory that gets automatically deleted after
85 usage. 85 usage.
86 """ 86 """
87 name = tempfile.mkdtemp() 87 name = tempfile.mkdtemp()
88 try: 88 try:
89 yield name 89 yield name
90 finally: 90 finally:
91 shutil.rmtree(name) 91 shutil.rmtree(name)
92
93
94 def EnsureParentDirectoryExists(path):
95 """Verifies that the parent directory exists or creates it if missing."""
96 parent_directory_path = os.path.abspath(os.path.dirname(path))
97 if not os.path.isdir(parent_directory_path):
98 os.makedirs(parent_directory_path)
OLDNEW
« no previous file with comments | « no previous file | tools/android/loading/sandwich.py » ('j') | tools/android/loading/sandwich_misc.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698