
Public Member Functions | |
| def | __call__ (self, override) |
| def | __init__ (self, parsetree, renderfunc, data=None) |
| def | __str__ (self) |
| def | __unicode__ (self) |
Public Attributes | |
| current_data | |
| data | |
| parsetree | |
Private Attributes | |
| _render | |
Basic template-class.
Used both for the template itself and for 'macro's ("subtemplates") in
the template.
Definition at line 989 of file pyratemp.py.
| def libuavcan_dsdl_compiler.pyratemp.TemplateBase.__init__ | ( | self, | |
| parsetree, | |||
| renderfunc, | |||
data = None |
|||
| ) |
Create the Template/Subtemplate/Macro.
:Parameters:
- `parsetree`: parse-tree of the template/subtemplate/macro
- `renderfunc`: render-function
- `data`: data to fill into the template by default (dictionary).
This data may later be overridden when rendering the template.
:Exceptions:
- `TypeError`: if `data` is not a dictionary
Definition at line 996 of file pyratemp.py.
| def libuavcan_dsdl_compiler.pyratemp.TemplateBase.__call__ | ( | self, | |
| override | |||
| ) |
Fill out/render the template.
:Parameters:
- `override`: objects to add to the data-namespace, overriding
the "default"-data.
:Returns: the filled template (in unicode)
:Note: This is also called when invoking macros
(i.e. ``$!mymacro()!$``).
Definition at line 1018 of file pyratemp.py.
| def libuavcan_dsdl_compiler.pyratemp.TemplateBase.__str__ | ( | self | ) |
Alias for __call__().
Definition at line 1037 of file pyratemp.py.
| def libuavcan_dsdl_compiler.pyratemp.TemplateBase.__unicode__ | ( | self | ) |
Alias for __call__().
Definition at line 1034 of file pyratemp.py.
|
private |
Definition at line 1016 of file pyratemp.py.
| libuavcan_dsdl_compiler.pyratemp.TemplateBase.current_data |
Definition at line 1015 of file pyratemp.py.
| libuavcan_dsdl_compiler.pyratemp.TemplateBase.data |
Definition at line 1010 of file pyratemp.py.
| libuavcan_dsdl_compiler.pyratemp.TemplateBase.parsetree |
Definition at line 1008 of file pyratemp.py.