Public Member Functions | Public Attributes | Private Attributes | List of all members
libuavcan_dsdl_compiler.pyratemp.TemplateBase Class Reference
Inheritance diagram for libuavcan_dsdl_compiler.pyratemp.TemplateBase:
Inheritance graph
[legend]

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
 

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

◆ __init__()

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.

Member Function Documentation

◆ __call__()

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.

◆ __str__()

def libuavcan_dsdl_compiler.pyratemp.TemplateBase.__str__ (   self)
Alias for __call__().

Definition at line 1037 of file pyratemp.py.

◆ __unicode__()

def libuavcan_dsdl_compiler.pyratemp.TemplateBase.__unicode__ (   self)
Alias for __call__().

Definition at line 1034 of file pyratemp.py.

Member Data Documentation

◆ _render

libuavcan_dsdl_compiler.pyratemp.TemplateBase._render
private

Definition at line 1016 of file pyratemp.py.

◆ current_data

libuavcan_dsdl_compiler.pyratemp.TemplateBase.current_data

Definition at line 1015 of file pyratemp.py.

◆ data

libuavcan_dsdl_compiler.pyratemp.TemplateBase.data

Definition at line 1010 of file pyratemp.py.

◆ parsetree

libuavcan_dsdl_compiler.pyratemp.TemplateBase.parsetree

Definition at line 1008 of file pyratemp.py.


The documentation for this class was generated from the following file:


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:04