Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import json | 4 import json |
| 5 import logging | 5 import logging |
| 6 | 6 |
| 7 from infra.services.gnumbd.support.util import cached_property | 7 from infra.libs.decorators import cached_property |
| 8 from infra.services.gnumbd.support.git import INVALID | 8 |
|
agable
2014/06/27 18:53:11
nit: no newline
| |
| 9 from infra.libs.git2 import INVALID | |
| 9 | 10 |
|
agable
2014/06/27 18:53:12
nit: two newlines.
| |
| 10 LOGGER = logging.getLogger(__name__) | 11 LOGGER = logging.getLogger(__name__) |
| 11 | 12 |
| 12 class ConfigRef(object): | 13 class ConfigRef(object): |
| 13 CONVERT = { | 14 CONVERT = { |
| 14 'interval': lambda self, val: float(val), | 15 'interval': lambda self, val: float(val), |
| 15 'pending_tag_prefix': lambda self, val: str(val), | 16 'pending_tag_prefix': lambda self, val: str(val), |
| 16 'pending_ref_prefix': lambda self, val: str(val), | 17 'pending_ref_prefix': lambda self, val: str(val), |
| 17 'enabled_refglobs': lambda self, val: map(str, list(val)), | 18 'enabled_refglobs': lambda self, val: map(str, list(val)), |
| 18 } | 19 } |
| 19 DEFAULTS = { | 20 DEFAULTS = { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 except Exception: | 55 except Exception: |
| 55 LOGGER.exception('Caught exception while processing') | 56 LOGGER.exception('Caught exception while processing') |
| 56 finally: | 57 finally: |
| 57 cur = cur.parent | 58 cur = cur.parent |
| 58 LOGGER.warn('Using default config: %r', self.DEFAULTS) | 59 LOGGER.warn('Using default config: %r', self.DEFAULTS) |
| 59 return dict(self.DEFAULTS) | 60 return dict(self.DEFAULTS) |
| 60 | 61 |
| 61 def evaluate(self): | 62 def evaluate(self): |
| 62 del self.current | 63 del self.current |
| 63 return self.current | 64 return self.current |
| OLD | NEW |