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

Side by Side Diff: tools/update_reference_build.py

Issue 1017863003: Rename to avoid redefining a builtin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Updates the Chrome reference builds. 7 """Updates the Chrome reference builds.
8 8
9 Before running this script, you should first verify that you are authenticated 9 Before running this script, you should first verify that you are authenticated
10 for SVN. You can do this by running: 10 for SVN. You can do this by running:
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 os.makedirs(os.path.dirname(dest)) 209 os.makedirs(os.path.dirname(dest))
210 with z.open(content) as unzipped_content: 210 with z.open(content) as unzipped_content:
211 logging.info('Extracting %s to %s (%s)', content, dest, dl_file) 211 logging.info('Extracting %s to %s (%s)', content, dest, dl_file)
212 with file(dest, 'wb') as dest_file: 212 with file(dest, 'wb') as dest_file:
213 dest_file.write(unzipped_content.read()) 213 dest_file.write(unzipped_content.read())
214 permissions = z.getinfo(content).external_attr >> 16 214 permissions = z.getinfo(content).external_attr >> 16
215 if permissions: 215 if permissions:
216 os.chmod(dest, permissions) 216 os.chmod(dest, permissions)
217 return True 217 return True
218 218
219 def _ClearDir(self, dir): 219 def _ClearDir(self, directory):
220 """Clears all files in |dir| except for hidden files and folders.""" 220 """Clears all files in |directory| except for hidden files and folders."""
221 for root, dirs, files in os.walk(dir): 221 for root, dirs, files in os.walk(directory):
222 # Skip hidden files and folders (like .svn and .git). 222 # Skip hidden files and folders (like .svn and .git).
223 files = [f for f in files if f[0] != '.'] 223 files = [f for f in files if f[0] != '.']
224 dirs[:] = [d for d in dirs if d[0] != '.'] 224 dirs[:] = [d for d in dirs if d[0] != '.']
225 225
226 for f in files: 226 for f in files:
227 os.remove(os.path.join(root, f)) 227 os.remove(os.path.join(root, f))
228 228
229 def _ExtractBuilds(self): 229 def _ExtractBuilds(self):
230 for platform in self._platforms: 230 for platform in self._platforms:
231 if os.path.exists('tmp_unzip'): 231 if os.path.exists('tmp_unzip'):
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 def main(argv): 286 def main(argv):
287 logging.getLogger().setLevel(logging.DEBUG) 287 logging.getLogger().setLevel(logging.DEBUG)
288 version, options = ParseOptions(argv) 288 version, options = ParseOptions(argv)
289 b = BuildUpdater(version, options) 289 b = BuildUpdater(version, options)
290 b.DownloadAndUpdateBuilds() 290 b.DownloadAndUpdateBuilds()
291 logging.info('Successfully updated reference builds. Move to ' 291 logging.info('Successfully updated reference builds. Move to '
292 'reference_builds/reference_builds and make a change with gcl.') 292 'reference_builds/reference_builds and make a change with gcl.')
293 293
294 if __name__ == '__main__': 294 if __name__ == '__main__':
295 sys.exit(main(sys.argv)) 295 sys.exit(main(sys.argv))
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