libuav original

Dependents:   UAVCAN UAVCAN_Subscriber

Embed: (wiki syntax)

« Back to documentation index

TemplateBase Class Reference

TemplateBase Class Reference

Inherited by Template.

Public Member Functions

def __init__
def __call__
def __unicode__
def __str__

Detailed Description

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.


Constructor & Destructor Documentation

def __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.


Member Function Documentation

def __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 __str__ (   self )
Alias for __call__().

Definition at line 1037 of file pyratemp.py.

def __unicode__ (   self )
Alias for __call__().

Definition at line 1034 of file pyratemp.py.