class Variable:
A template variable, resolvable against a given context. The variable may be a hard-coded string (if it begins and ends with single or double quote marks):
>>> c = {'article': {'section':'News'}} >>> Variable('article.section').resolve(c) 'News' >>> Variable('article').resolve(c) {'section': 'News'} >>> class AClass: pass >>> c = AClass() >>> c.article = AClass() >>> c.article.section = 'News'
(The example assumes VARIABLE_ATTRIBUTE_SEPARATOR is '.')
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | _resolve_lookup |
Perform resolution of a real variable (i.e. not a literal) against the given context. |
Method | resolve |
Resolve this variable against a given context. |
Instance Variable | literal |
Undocumented |
Instance Variable | lookups |
Undocumented |
Instance Variable | message_context |
Undocumented |
Instance Variable | translate |
Undocumented |
Instance Variable | var |
Undocumented |