class documentation

class _GenerateRenderMethod: (source)

View In Hierarchy

A template visitor object which generates the full module source for a template.

Method __init__ Undocumented
Method create_filter_callable write a filter-applying expression based on the filters present in the given filter names, adjusting for the global 'default' filter aliases as needed.
Method visitBlockTag Undocumented
Method visitCallNamespaceTag Undocumented
Method visitCallTag Undocumented
Method visitCode Undocumented
Method visitControlLine Undocumented
Method visitDefTag Undocumented
Method visitExpression Undocumented
Method visitIncludeTag Undocumented
Method visitNamespaceTag Undocumented
Method visitText Undocumented
Method visitTextTag Undocumented
Method write_cache_decorator write a post-function decorator to replace a rendering callable with a cached version of itself.
Method write_def_decl write a locally-available callable referencing a top-level def
Method write_def_finish write the end section of a rendering function, either outermost or inline.
Method write_inherit write the module-level inheritance-determination callable.
Method write_inline_def write a locally-available def callable inside an enclosing def.
Method write_metadata_struct Undocumented
Method write_module_code write module-level template code, i.e. that which is enclosed in <%! %> tags in the template.
Method write_namespaces write the module-level namespace-generating callable.
Method write_render_callable write a top-level render callable.
Method write_toplevel Traverse a template structure for module-level directives and generate the start of module-level code.
Method write_variable_declares write variable declarations at the top of a function.
Instance Variable compiler Undocumented
Instance Variable identifier_stack Undocumented
Instance Variable in_def Undocumented
Instance Variable node Undocumented
Instance Variable printer Undocumented
Property identifiers Undocumented
def __init__(self, printer, compiler, node): (source)

Undocumented

def create_filter_callable(self, args, target, is_expression): (source)

write a filter-applying expression based on the filters present in the given filter names, adjusting for the global 'default' filter aliases as needed.

def visitBlockTag(self, node): (source)

Undocumented

def visitCallNamespaceTag(self, node): (source)

Undocumented

def visitCallTag(self, node): (source)

Undocumented

def visitCode(self, node): (source)

Undocumented

def visitControlLine(self, node): (source)

Undocumented

def visitDefTag(self, node): (source)

Undocumented

def visitExpression(self, node): (source)

Undocumented

def visitIncludeTag(self, node): (source)

Undocumented

def visitNamespaceTag(self, node): (source)

Undocumented

def visitText(self, node): (source)

Undocumented

def visitTextTag(self, node): (source)

Undocumented

def write_cache_decorator(self, node_or_pagetag, name, args, buffered, identifiers, inline=False, toplevel=False): (source)

write a post-function decorator to replace a rendering callable with a cached version of itself.

def write_def_decl(self, node, identifiers): (source)

write a locally-available callable referencing a top-level def

def write_def_finish(self, node, buffered, filtered, cached, callstack=True): (source)

write the end section of a rendering function, either outermost or inline. this takes into account if the rendering function was filtered, buffered, etc. and closes the corresponding try: block if any, and writes code to retrieve captured content, apply filters, send proper return value.

def write_inherit(self, node): (source)

write the module-level inheritance-determination callable.

def write_inline_def(self, node, identifiers, nested): (source)

write a locally-available def callable inside an enclosing def.

def write_metadata_struct(self): (source)

Undocumented

def write_module_code(self, module_code): (source)

write module-level template code, i.e. that which is enclosed in <%! %> tags in the template.

def write_namespaces(self, namespaces): (source)

write the module-level namespace-generating callable.

def write_render_callable(self, node, name, args, buffered, filtered, cached): (source)

write a top-level render callable. this could be the main render() method or that of a top-level def.

def write_toplevel(self): (source)

Traverse a template structure for module-level directives and generate the start of module-level code.

def write_variable_declares(self, identifiers, toplevel=False, limit=None): (source)

write variable declarations at the top of a function. the variable declarations are in the form of callable definitions for defs and/or name lookup within the function's context argument. the names declared are based on the names that are referenced in the function body, which don't otherwise have any explicit assignment operation. names that are assigned within the body are assumed to be locally-scoped variables and are not separately declared. for def callable definitions, if the def is a top-level callable then a 'stub' callable is generated which wraps the current Context into a closure. if the def is not top-level, it is fully rendered as a local closure.

compiler = (source)

Undocumented

identifier_stack: list = (source)

Undocumented

Undocumented

Undocumented

Undocumented

@property
identifiers = (source)

Undocumented