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

Side by Side Diff: infra/libs/git2/config_ref.py

Issue 355153002: Refactor infra git libs and testing. (Closed) Base URL: https://chromium.googlesource.com/infra/infra@fake_testing_support
Patch Set: Created 6 years, 5 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
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698