]> mj.ucw.cz Git - eval.git/commitdiff
Now moe module, update ConfigError, minor fix
authorTomas Gavenciak <gavento@matfyz.cz>
Sat, 29 May 2010 17:26:47 +0000 (13:26 -0400)
committerTomas Gavenciak <gavento@matfyz.cz>
Sat, 29 May 2010 17:26:47 +0000 (13:26 -0400)
t/moe/conf.py
t/moe/confparser.py

index 156406860053b2926490817e8ac75bef108b20d0..f561b750773ce752d3d043c570f7411d514dd722 100644 (file)
@@ -26,6 +26,7 @@ TODO: Test conditions and unicode
 
 import types, itertools, re, bisect
 import logging as log
+from moe import MoeError
 
 "Allowed depth of recursion - includes ALL recursive calls, so should quite high."
 c_maxdepth = 256
@@ -45,7 +46,7 @@ def check_depth(depth):
     debug_maxdepth = depth
 
 
-class ConfigError(Exception):
+class ConfigError(MoeError):
   pass
 
 class UndefinedError(ConfigError):
@@ -254,7 +255,7 @@ class ConfigVar(ConfigElem):
        v.dependants.remove(self)
     # Remove the dependency on the conditions (if not used in another operation)
     if operation.condition and operation.condition not in [op.condition for op in self.operations]:
-      condition.dependants.remove(self)
+      operation.condition.dependants.remove(self)
   def evaluate(self, depth=0):
     """
     Find the last 'SET' operation that applies and return the result of concatenating with all
index e2f81b884be10e11fd209cd4aa7955dcfad3e7dd..fed00ea8c630fe926b544be86f81ed63e42212b4 100644 (file)
@@ -35,6 +35,8 @@ AND = FORMULA WS 'and' FORMULA
 OR = FORMULA WS 'or' FORMULA
 NOT = WS 'not' FORMULA 
 
+NOTE: ';' or '\n' is currently required even after CONDITION and SUBTREE block 
+  TODO: change to OPERATION only
 NOTE: Formula may contain additional/extra parentheses
 
 EXPRESSION = '"' ( ECHAR | '{' VARNAME '}' )* '"' | re"'[^'\\n]*'"
@@ -44,7 +46,7 @@ VARNAME = re('[a-zA-Z0-9-_]+(\.[a-zA-Z0-9-_]+)*')
 
 import re, types, itertools, logging as log
 import traceback
-import conf
+import moe.conf
 
 class ConfigSyntaxError(conf.ConfigError):
   def __init__(self, msg, fname='<unknown>', line=None, column=None):