pyfarm.agent.http.core.template module

Template

Interface methods for working with the Jinja template engine.

class pyfarm.agent.http.core.template.InMemoryCache[source]

Bases: jinja2.bccache.BytecodeCache

Caches Jinja templates into memory after they have been loaded and compiled.

cache = {}
clear()[source]
load_bytecode(bucket)[source]
dump_bytecode(bucket)[source]
class pyfarm.agent.http.core.template.DeferredTemplate[source]

Bases: jinja2.environment.Template

Overrides the default PackageLoader so we can produced the rendered result as a deferred call.

render(*args, **kwargs)[source]
class pyfarm.agent.http.core.template.Environment(**kwargs)[source]

Bases: jinja2.environment.Environment

Implementation of Jinja’s _Environment class which reads from our configuration object and establishes the default functions we can use in a template.

template_class

alias of DeferredTemplate

class pyfarm.agent.http.core.template.Loader[source]

Bases: object

Namespace class used to simply keep track of the global environment and load templates.

>>> from pyfarm.agent.http.core import template
>>> template.load("index.html")
environment = None
classmethod load(name)[source]