X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=t%2Fmoe%2Fconfig.py;h=f24e1ef8f357748b41b13f2b8cff20419cfb90d7;hb=b6a35869aee6b2b228b89609c25e081f5761e0dd;hp=813976c3980f756bc41306e769b6520d4e0cb523;hpb=d8de72934717e8f287301c07d2ec70f1ca332e79;p=eval.git diff --git a/t/moe/config.py b/t/moe/config.py index 813976c..f24e1ef 100644 --- a/t/moe/config.py +++ b/t/moe/config.py @@ -1,25 +1,22 @@ """ config.py -------- +--------- Lazy conditional string evaluation module for Moe configuration variables. * Each variable has ordered list of operations (definitions), each defining operation either -assigns (SET) or appends (APPEND) value of an expression to the variable. Each operation may be guarded by condition(s). - -NOTE: If no 'SET' applies, a variable is still undefined even if some 'APPEND' applies. This might change. + assigns (SET) or appends (APPEND) value of an expression to the variable. Each operation may be guarded by condition(s). * Each condition is a formula (tree consisting of 'AND', 'OR', 'NOT' and '==', '!=' between two expressions. * Expression is a list of strings and variables to be expanded. -NOTE: All expanded data should be (or is converted to) unicode - - -TODO (OPT): Cleanup of unused undefined variables. -TODO (OPT): Better variable name checking (no name '.'-structural prefix of another) -TODO (OPT): Implemet "subtree" listing. +.. note:: If no 'SET' applies, a variable is still undefined even if some 'APPEND' applies. This might change. +.. note:: All expanded data should be (or is converted to) unicode +.. todo:: (OPT) Cleanup of unused undefined variables. +.. todo:: (OPT) Better variable name checking (no name '.'-structural prefix of another) +.. todo:: (OPT) Implemet "subtree" listing. """ import types, itertools, re, bisect @@ -159,9 +156,11 @@ class ConfigElem(object): class ConfigCondition(ConfigElem): """ Condition using equality and logic operators. - Clause is a tuple-tree in the following recursive form: - ('AND', c1, c1), ('OR', c1, c2), ('NOT', c1), - ('==', e1, e2), ('!=', e1, e2) where e1, e2 are `ConfigExpression`s. + Clause is a tuple-tree in the following recursive form:: + + ('AND', c1, c1), ('OR', c1, c2), ('NOT', c1), ('==', e1, e2), ('!=', e1, e2) + + where e1, e2 are `ConfigExpression`, c1, c2, `ConfigCondition`. """ def __init__(self, formula, text=None, parent=None):