Commit 792ce17d by Chris Jerdonek

Improved a docstring in template.py.

parent cba3c79c
...@@ -11,32 +11,30 @@ This module is meant only for internal use. ...@@ -11,32 +11,30 @@ This module is meant only for internal use.
class ParsedTemplate(object): class ParsedTemplate(object):
def __init__(self, parse_tree): def __init__(self, parse_tree):
self._parse_tree = parse_tree
def render(self, context):
""" """
Returns: a string of type unicode. Arguments:
parse_tree: a list, each element of which is either--
The elements of parse_tree can be any of the following: (1) a unicode string, or
(2) a "rendering" callable that accepts a Context instance
and returns a unicode string.
* a unicode string The possible rendering callables are the return values of the
* the return value of a call to any of the following: following functions:
* RenderEngine._make_get_literal(): * RenderEngine._make_get_escaped()
Args: context * RenderEngine._make_get_inverse()
Returns: unicode * RenderEngine._make_get_literal()
* RenderEngine._make_get_escaped():
Args: context
Returns: unicode
* RenderEngine._make_get_partial() * RenderEngine._make_get_partial()
Args: context
Returns: unicode
* RenderEngine._make_get_section() * RenderEngine._make_get_section()
Args: context
Returns: unicode """
* _make_get_inverse() self._parse_tree = parse_tree
Args: context
Returns: unicode def render(self, context):
"""
Returns: a string of type unicode.
""" """
get_unicode = lambda val: val(context) if callable(val) else val get_unicode = lambda val: val(context) if callable(val) else val
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment