]> mj.ucw.cz Git - eval.git/commitdiff
Removed config resolution caching
authorMartin Mares <mj@ucw.cz>
Fri, 14 Aug 2009 08:28:53 +0000 (10:28 +0200)
committerMartin Mares <mj@ucw.cz>
Fri, 14 Aug 2009 08:28:53 +0000 (10:28 +0200)
t/moe/config.py

index 95cc316b4972cfb5020a24bfba4bba94752f10f9..4b411d8ce3876e7139056919aafd8ab972ec013b 100644 (file)
@@ -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