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

Side by Side Diff: build/android/gyp/util/build_utils.py

Issue 328343005: Fix python build util script exception (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 fnmatch 6 import fnmatch
7 import json 7 import json
8 import os 8 import os
9 import pipes 9 import pipes
10 import shlex 10 import shlex
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 return False 163 return False
164 164
165 165
166 def IsDeviceReady(): 166 def IsDeviceReady():
167 device_state = CheckOutput(['adb', 'get-state']) 167 device_state = CheckOutput(['adb', 'get-state'])
168 return device_state.strip() == 'device' 168 return device_state.strip() == 'device'
169 169
170 170
171 def CheckZipPath(name): 171 def CheckZipPath(name):
172 if os.path.normpath(name) != name: 172 if os.path.normpath(name) != name:
173 raise Exception('Non-canonical zip path: %s, %s' % name) 173 raise Exception('Non-canonical zip path: %s' % name)
174 if os.path.isabs(name): 174 if os.path.isabs(name):
175 raise Exception('Absolute zip path: %s, %s' % name) 175 raise Exception('Absolute zip path: %s' % name)
176 176
177 177
178 def ExtractAll(zip_path, path=None, no_clobber=True): 178 def ExtractAll(zip_path, path=None, no_clobber=True):
179 if path is None: 179 if path is None:
180 path = os.getcwd() 180 path = os.getcwd()
181 elif not os.path.exists(path): 181 elif not os.path.exists(path):
182 MakeDirectory(path) 182 MakeDirectory(path)
183 183
184 with zipfile.ZipFile(zip_path) as z: 184 with zipfile.ZipFile(zip_path) as z:
185 for name in z.namelist(): 185 for name in z.namelist():
(...skipping 16 matching lines...) Expand all
202 202
203 203
204 def PrintWarning(message): 204 def PrintWarning(message):
205 print 'WARNING: ' + message 205 print 'WARNING: ' + message
206 206
207 207
208 def PrintBigWarning(message): 208 def PrintBigWarning(message):
209 print '***** ' * 8 209 print '***** ' * 8
210 PrintWarning(message) 210 PrintWarning(message)
211 print '***** ' * 8 211 print '***** ' * 8
OLDNEW
« 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