module documentation

provides runtime services for templates, including Context, Namespace, and various helper functions.

Class CallerStack Undocumented
Class Context Provides runtime namespace, output buffer, and various callstacks for templates.
Class LoopContext A magic loop variable. Automatically accessible in any ``% for`` block.
Class LoopStack a stack for LoopContexts that implements the context manager protocol to automatically pop off the top of the stack on context exit
Class ModuleNamespace A :class:`.Namespace` specific to a Python module instance.
Class Namespace Provides access to collections of rendering methods, which can be local, from other templates, or from imported modules.
Class TemplateNamespace A :class:`.Namespace` specific to a :class:`.Template` instance.
Class Undefined Represents an undefined value in a template.
Function capture Execute the given template def, capturing the output into a buffer.
Function supports_caller Apply a caller_stack compatibility decorator to a plain Python function.
Constant STOP_RENDERING Undocumented
Constant UNDEFINED Undocumented
Class _NSAttr Undocumented
Function _decorate_inline Undocumented
Function _decorate_toplevel Undocumented
Function _exec_template execute a rendering callable given the callable, a Context, and optional explicit arguments
Function _include_file locate the template from the given uri and include it in the current output.
Function _inherit_from called by the _inherit method in template modules to set up the inheritance chain at the start of a template's execution.
Function _kwargs_for_callable Undocumented
Function _kwargs_for_include Undocumented
Function _lookup_template Undocumented
Function _populate_self_namespace Undocumented
Function _render create a Context and return the string output of the given template and template callable.
Function _render_context Undocumented
Function _render_error Undocumented
def capture(context, callable_, *args, **kwargs): (source)

Execute the given template def, capturing the output into a buffer. See the example in :ref:`namespaces_python_modules`.

def supports_caller(func): (source)

Apply a caller_stack compatibility decorator to a plain Python function. See the example in :ref:`namespaces_python_modules`.

STOP_RENDERING: str = (source)

Undocumented

Value
''
UNDEFINED = (source)

Undocumented

Value
Undefined()
def _decorate_inline(context, fn): (source)

Undocumented

def _decorate_toplevel(fn): (source)

Undocumented

def _exec_template(callable_, context, args=None, kwargs=None): (source)

execute a rendering callable given the callable, a Context, and optional explicit arguments the contextual Template will be located if it exists, and the error handling options specified on that Template will be interpreted here.

def _include_file(context, uri, calling_uri, **kwargs): (source)

locate the template from the given uri and include it in the current output.

def _inherit_from(context, uri, calling_uri): (source)

called by the _inherit method in template modules to set up the inheritance chain at the start of a template's execution.

def _kwargs_for_callable(callable_, data): (source)

Undocumented

def _kwargs_for_include(callable_, data, **kwargs): (source)

Undocumented

def _lookup_template(context, uri, relativeto): (source)

Undocumented

def _populate_self_namespace(context, template, self_ns=None): (source)

Undocumented

def _render(template, callable_, args, data, as_unicode=False): (source)

create a Context and return the string output of the given template and template callable.

def _render_context(tmpl, callable_, context, *args, **kwargs): (source)

Undocumented

def _render_error(template, context, error): (source)

Undocumented