class documentation

class TemplateProcessor(object): (source)

View In Hierarchy

The template processor takes a parsed template and "executes" it one or more times.
Method __call__ Undocumented
Method __init__ Constructor @param parts: A list of SimplerTreeElements as produced by TemplateParser.parse()
Method process No summary
Instance Variable blocks Undocumented
Instance Variable main Undocumented
Instance Variable parse_included_file_func Undocumented
Static Method _set Undocumented
Method _include_block Undocumented
Method _include_file Undocumented
Method _loop Undocumented
def __call__(self, output, elements, context): (source)

Undocumented

def __init__(self, parts, parse_included_file_func=None): (source)
Constructor
Parameters
partsA list of SimplerTreeElements as produced by TemplateParser.parse()
parse_included_file_funcUndocumented
def process(self, output, context): (source)
Execute the template once
Parameters
outputan object to receive the template output, can be a list and should support at least an append() method to receive string content
contexta TemplateContextDict object with the template parameters
blocks: dict = (source)

Undocumented

main = (source)

Undocumented

parse_included_file_func = (source)

Undocumented

@staticmethod
def _set(context, var, value): (source)

Undocumented

def _include_block(self, output, name, context): (source)

Undocumented

def _include_file(self, output, path, context): (source)

Undocumented

def _loop(self, output, element, context): (source)

Undocumented