Changeset 565
- Timestamp:
- 07/12/08 01:38:15 (5 months ago)
- Files:
-
- cly/trunk/cly/builder.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cly/trunk/cly/builder.py
r560 r565 931 931 to the evaluated expression, as well as some additional variables: 932 932 933 :v: All variables from the parse Context. 933 :c: :class:`~cly.parser.Context` object. 934 :v: All variables from the :class:`~cly.parser.Context`. 934 935 :d: The "data" dictionary. 935 936 :a: Any positional arguments. 936 937 :kw: Any keyword arguments. 937 :all(*keys): Returns true if all keys are valid symbols.938 :any(*keys): Returns true if any keys are valiid symbols.939 938 940 939 v in particular is useful for passing all collected arguments to … … 1091 1090 positional_args = positional_args or [] 1092 1091 def xml_attr_evaluator(*args, **kwargs): 1093 def all(*v):1094 """Return true if all arguments are defined symbols."""1095 for i in v:1096 if i not in locals:1097 return False1098 return True1099 1100 def any(*v):1101 """Return true if any arguments are defined symbols."""1102 for i in v:1103 if i in locals:1104 return True1105 return False1106 1107 1092 locals = dict(kwargs) 1108 1093 … … 1130 1115 locals['kw'] = kwargs 1131 1116 locals['d'] = data 1132 locals['all'] = all 1133 locals['any'] = any 1117 locals['c'] = context 1134 1118 try: 1135 1119 return eval(attr, locals)
