| OLD | NEW |
| 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 from slave import recipe_api | 5 from slave import recipe_api |
| 6 | 6 |
| 7 GIT_DEFAULT_WHITELIST = frozenset(( | 7 GIT_DEFAULT_WHITELIST = frozenset(( |
| 8 'tools_build', | 8 'tools_build', |
| 9 )) | 9 )) |
| 10 | 10 |
| 11 def jsonish_to_python(spec, is_top=False): | 11 def jsonish_to_python(spec, is_top=False): |
| 12 ret = '' | 12 ret = '' |
| 13 if is_top: # We're the 'top' level, so treat this dict as a suite. | 13 if is_top: # We're the 'top' level, so treat this dict as a suite. |
| 14 ret = '\n'.join( | 14 ret = '\n'.join( |
| 15 '%s = %s' % (k, jsonish_to_python(spec[k])) for k in sorted(spec) | 15 '%s = %s' % (k, jsonish_to_python(spec[k])) for k in sorted(spec) |
| 16 ) | 16 ) |
| 17 else: | 17 else: |
| 18 if isinstance(spec, dict): | 18 if isinstance(spec, dict): |
| 19 ret += '{' | 19 ret += '{' |
| 20 ret += ', '.join( | 20 ret += ', '.join( |
| 21 "%s: %s" % (repr(str(k)), jsonish_to_python(spec[k])) for k in sorted(sp
ec)) | 21 "%s: %s" % (repr(str(k)), jsonish_to_python(spec[k])) |
| 22 for k in sorted(spec) |
| 23 ) |
| 22 ret += '}' | 24 ret += '}' |
| 23 elif isinstance(spec, list): | 25 elif isinstance(spec, list): |
| 24 ret += '[' | 26 ret += '[' |
| 25 ret += ', '.join(jsonish_to_python(x) for x in spec) | 27 ret += ', '.join(jsonish_to_python(x) for x in spec) |
| 26 ret += ']' | 28 ret += ']' |
| 27 elif isinstance(spec, basestring): | 29 elif isinstance(spec, basestring): |
| 28 ret = repr(str(spec)) | 30 ret = repr(str(spec)) |
| 29 else: | 31 else: |
| 30 ret = repr(spec) | 32 ret = repr(spec) |
| 31 return ret | 33 return ret |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 self.m.path.build('scripts', 'slave', 'gclient_safe_revert.py'), | 156 self.m.path.build('scripts', 'slave', 'gclient_safe_revert.py'), |
| 155 ['.', self.m.path.depot_tools('gclient', wrapper=True)], | 157 ['.', self.m.path.depot_tools('gclient', wrapper=True)], |
| 156 **kwargs | 158 **kwargs |
| 157 ) | 159 ) |
| 158 | 160 |
| 159 def runhooks(self, args=None, **kwargs): | 161 def runhooks(self, args=None, **kwargs): |
| 160 """Return a 'gclient runhooks' step.""" | 162 """Return a 'gclient runhooks' step.""" |
| 161 args = args or [] | 163 args = args or [] |
| 162 assert isinstance(args, (list, tuple)) | 164 assert isinstance(args, (list, tuple)) |
| 163 return self('runhooks', ['runhooks'] + list(args), **kwargs) | 165 return self('runhooks', ['runhooks'] + list(args), **kwargs) |
| OLD | NEW |