Package genshi :: Package template :: Module eval :: Class Suite

Class Suite

object --+    
         |    
      Code --+
             |
            Suite

Executes Python statements used in templates.

>>> data = dict(test='Foo', items=[1, 2, 3], dict={'some': 'thing'})
>>> Suite("foo = dict['some']").execute(data)
>>> data['foo']
'thing'
Instance Methods
 
execute(self, data)
Execute the suite in the given data dictionary.

Inherited from Code: __eq__, __getstate__, __hash__, __init__, __ne__, __repr__, __setstate__

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  mode = 'exec'
Properties

Inherited from Code: ast, code, source

Inherited from object: __class__

Method Details

execute(self, data)

 
Execute the suite in the given data dictionary.
Parameters:
  • data - a mapping containing the data to execute in