pystache.parsed module

Exposes a class that represents a parsed (or compiled) template.

class pystache.parsed.ParsedTemplate[source]

Bases: object

Represents a parsed or compiled template.

An instance wraps a list of unicode strings and node objects. A node object must have a render(engine, stack) method that accepts a RenderEngine instance and a ContextStack instance and returns a unicode string.

add(node)[source]

Arguments:

node: a unicode string or node object instance. See the class

docstring for information.

render(engine, context)[source]

Returns: a string of type unicode.