libuav original

Dependents:   UAVCAN UAVCAN_Subscriber

Embed: (wiki syntax)

« Back to documentation index

Template Class Reference

Template Class Reference

Inherits libuavcan_dsdl_compiler::pyratemp::TemplateBase.

Public Member Functions

def __init__
def __call__
def __unicode__
def __str__

Detailed Description

Template-User-Interface.

:Usage:
    ::
        t = Template(...)  (<- see __init__)
        output = t(...)    (<- see TemplateBase.__call__)

:Example:
    see module-docstring

Definition at line 1149 of file pyratemp.py.


Constructor & Destructor Documentation

def __init__ (   self,
  string = None,
  filename = None,
  parsetree = None,
  encoding = 'utf-8',
  data = None,
  escape = HTML,
  loader_class = LoaderFile,
  parser_class = Parser,
  renderer_class = Renderer,
  eval_class = EvalPseudoSandbox,
  escape_func = escape 
)
Load (+parse) a template.

:Parameters:
    - `string,filename,parsetree`: a template-string,
                           filename of a template to load,
                           or a template-parsetree.
                           (only one of these 3 is allowed)
    - `encoding`: encoding of the template-files (only used for "filename")
    - `data`:     data to fill into the template by default (dictionary).
          This data may later be overridden when rendering the template.
    - `escape`:   default-escaping for the template, may be overwritten by the template!
    - `loader_class`
    - `parser_class`
    - `renderer_class`
    - `eval_class`
    - `escapefunc`

Definition at line 1161 of file pyratemp.py.


Member Function Documentation

def __call__ (   self,
  override 
) [inherited]
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 ) [inherited]
Alias for __call__().

Definition at line 1037 of file pyratemp.py.

def __unicode__ (   self ) [inherited]
Alias for __call__().

Definition at line 1034 of file pyratemp.py.