pystache.renderengine module
Defines a class responsible for rendering logic.
- class pystache.renderengine.RenderEngine(literal=None, escape=None, resolve_context=None, resolve_partial=None, to_str=None)[source]
Bases:
object
Provides a render() method.
This class is meant only for internal use.
As a rule, the code in this class operates on unicode strings where possible rather than, say, strings of type str or markupsafe.Markup. This means that strings obtained from “external” sources like partials and variable tag values are immediately converted to unicode (or escaped and converted to unicode) before being operated on further. This makes maintaining, reasoning about, and testing the correctness of the code much simpler. In particular, it keeps the implementation of this class independent of the API details of one (or possibly more) unicode subclasses (e.g. markupsafe.Markup).