From: Martin Mares Date: Fri, 14 Aug 2009 08:28:53 +0000 (+0200) Subject: Removed config resolution caching X-Git-Tag: python-dummy-working~69 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=aa14b89c819af9c525221a8ee3d6662febf6a20e;p=eval.git Removed config resolution caching --- diff --git a/t/moe/config.py b/t/moe/config.py index 95cc316..4b411d8 100644 --- a/t/moe/config.py +++ b/t/moe/config.py @@ -121,31 +121,21 @@ class MoeConfigStack: """Stack of configuration files.""" def __init__(self, base=None): - ## FIXME: Do we need to duplicate the config files themselves? if base: self.stk = base.stk[:] else: self.stk = [] self.in_progress = {} - self.reset_cache() - - def reset_cache(self): - self.cache = {} def push(self, cfg): self.stk.append(cfg) - self.reset_cache() def __getitem__(self, k): - if self.cache.has_key(k): - return self.cache[k] if self.in_progress.has_key(k): raise MoeConfigEvalError, "Definition of $%s is recursive" % k; self.in_progress[k] = 1; v = self.do_get(k, len(self.stk)-1) del self.in_progress[k] - ## FIXME: This is disabled, because the immutability invariant is broken! - # self.cache[k] = v return v def do_get(self, k, pos): @@ -205,7 +195,6 @@ class MoeConfigStack: else: newstk.append(cfg) self.stk = newstk - self.reset_cache() def parse_overrides(argv): cfg = None