class documentation

class _GenerateRenderMethod(object):

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 visit​Block​Tag Undocumented
Method visit​Call​Namespace​Tag Undocumented
Method visit​Call​Tag Undocumented
Method visit​Code Undocumented
Method visit​Control​Line Undocumented
Method visit​Def​Tag Undocumented
Method visit​Expression Undocumented
Method visit​Include​Tag Undocumented
Method visit​Namespace​Tag Undocumented
Method visit​Text Undocumented
Method visit​Text​Tag 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):

Undocumented

def create_filter_callable(self, args, target, is_expression):
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):

Undocumented

def visitCallNamespaceTag(self, node):

Undocumented

def visitCallTag(self, node):

Undocumented

def visitCode(self, node):

Undocumented

def visitControlLine(self, node):

Undocumented

def visitDefTag(self, node):

Undocumented

def visitExpression(self, node):

Undocumented

def visitIncludeTag(self, node):

Undocumented

def visitNamespaceTag(self, node):

Undocumented

def visitText(self, node):

Undocumented

def visitTextTag(self, node):

Undocumented

def write_cache_decorator(self, node_or_pagetag, name, args, buffered, identifiers, inline=False, toplevel=False):
write a post-function decorator to replace a rendering callable with a cached version of itself.
def write_def_decl(self, node, identifiers):
write a locally-available callable referencing a top-level def
def write_def_finish(self, node, buffered, filtered, cached, callstack=True):

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):
write the module-level inheritance-determination callable.
def write_inline_def(self, node, identifiers, nested):
write a locally-available def callable inside an enclosing def.
def write_metadata_struct(self):

Undocumented

def write_module_code(self, module_code):
write module-level template code, i.e. that which is enclosed in <%! %> tags in the template.
def write_namespaces(self, namespaces):
write the module-level namespace-generating callable.
def write_render_callable(self, node, name, args, buffered, filtered, cached):

write a top-level render callable.

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

def write_toplevel(self):
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):

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 =

Undocumented

identifier_stack: list =

Undocumented

in_def: bool =

Undocumented

node =

Undocumented

printer =

Undocumented

@property
identifiers =

Undocumented