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

Side by Side Diff: tools/bots/bot_utils.py

Issue 197313010: Initial refactorings to support archiving the src and debian package builds. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « tools/bots/bot.py ('k') | tools/bots/src-tarball.py » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
4 # for details. All rights reserved. Use of this source code is governed by a 4 # for details. All rights reserved. Use of this source code is governed by a
5 # BSD-style license that can be found in the LICENSE file. 5 # BSD-style license that can be found in the LICENSE file.
6 6
7 import hashlib 7 import hashlib
8 import imp 8 import imp
9 import os 9 import os
10 import string
10 import subprocess 11 import subprocess
11 import sys 12 import sys
12 13
13 DART_DIR = os.path.abspath( 14 DART_DIR = os.path.abspath(
14 os.path.normpath(os.path.join(__file__, '..', '..', '..'))) 15 os.path.normpath(os.path.join(__file__, '..', '..', '..')))
15 16
16 def GetUtils(): 17 def GetUtils():
17 '''Dynamically load the tools/utils.py python module.''' 18 '''Dynamically load the tools/utils.py python module.'''
18 return imp.load_source('utils', os.path.join(DART_DIR, 'tools', 'utils.py')) 19 return imp.load_source('utils', os.path.join(DART_DIR, 'tools', 'utils.py'))
19 20
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 if not mangled_filename: 306 if not mangled_filename:
306 mangled_filename = os.path.basename(filename) 307 mangled_filename = os.path.basename(filename)
307 308
308 checksum = CalculateChecksum(filename) 309 checksum = CalculateChecksum(filename)
309 checksum_filename = '%s.md5sum' % filename 310 checksum_filename = '%s.md5sum' % filename
310 311
311 with open(checksum_filename, 'w') as f: 312 with open(checksum_filename, 'w') as f:
312 f.write('%s *%s' % (checksum, mangled_filename)) 313 f.write('%s *%s' % (checksum, mangled_filename))
313 314
314 return checksum_filename 315 return checksum_filename
316
317 def GetChannelFromName(name):
318 """Get the channel from the name. Bleeding edge builders don't
319 have a suffix."""
320 channel_name = string.split(name, '-').pop()
321 if channel_name in Channel.ALL_CHANNELS:
322 return channel_name
323 return Channel.BLEEDING_EDGE
OLDNEW
« no previous file with comments | « tools/bots/bot.py ('k') | tools/bots/src-tarball.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698