Package spade :: Module pyratemp :: Class Renderer
[hide private]
[frames] | no frames]

Class Renderer

source code


Render a template-parse-tree.

Instance Methods [hide private]
 
__init__(self, evalfunc)
Init the renderer.
source code
 
_eval(self, expr, data)
evalfunc with error-messages
source code
 
render(self, parsetree, data)
Render a parse-tree of a template.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, evalfunc)
(Constructor)

source code 

Init the renderer.

:Parameter:

  • evalfunc: function for template-expression-evaluation (i.e. TemplateEval().eval)
Overrides: object.__init__

render(self, parsetree, data)

source code 

Render a parse-tree of a template.

:Parameter:

  • parsetree: the parse-tree
  • data: the data to fill into the template (dictionary)

:Returns: the rendered output-unicode-string :Raises: TemplateRenderError