summaryrefslogtreecommitdiff
path: root/pystache/parsed.py
diff options
context:
space:
mode:
Diffstat (limited to 'pystache/parsed.py')
-rw-r--r--pystache/parsed.py30
1 files changed, 9 insertions, 21 deletions
diff --git a/pystache/parsed.py b/pystache/parsed.py
index e3c746f..e94c644 100644
--- a/pystache/parsed.py
+++ b/pystache/parsed.py
@@ -3,39 +3,27 @@
"""
Exposes a class that represents a parsed (or compiled) template.
-This module is meant only for internal use.
-
"""
class ParsedTemplate(object):
def __init__(self):
- """
- Arguments:
-
- parse_tree: a list, each element of which is either--
-
- (1) a unicode string, or
- (2) a "rendering" callable that accepts a ContextStack instance
- and returns a unicode string.
-
- The possible rendering callables are the return values of the
- following functions:
-
- * RenderEngine._make_get_escaped()
- * RenderEngine._make_get_inverse()
- * RenderEngine._make_get_literal()
- * RenderEngine._make_get_partial()
- * RenderEngine._make_get_section()
-
- """
self._parse_tree = []
def __repr__(self):
return repr(self._parse_tree)
def add(self, node):
+ """
+ Arguments:
+
+ node: a unicode string or node object instance. A node object
+ instance must have a `render(engine, stack)` method that
+ accepts a RenderEngine instance and a ContextStack instance and
+ returns a unicode string.
+
+ """
self._parse_tree.append(node)
def render(self, engine, context):