OLD | NEW |
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 Loading... |
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 |
OLD | NEW |