Commit 9c2048a1 by Chris Jerdonek

Removed call() function.

parent c1a96ac3
......@@ -17,13 +17,11 @@ DEFAULT_TAG_CLOSING = '}}'
END_OF_LINE_CHARACTERS = ['\r', '\n']
def call(val, context):
def render_parse_tree(parse_tree, context):
"""
Returns: a string of type unicode.
Arguments:
val: the argument val can be any of the following:
The elements of parse_tree can be any of the following:
* a unicode string
* the return value of a call to any of the following:
......@@ -45,19 +43,8 @@ def call(val, context):
Returns: unicode
"""
if callable(val):
val = val(context)
return val
def render_parse_tree(parse_tree, context):
"""
Returns: a string of type unicode.
"""
get_string = lambda val: call(val, context)
parts = map(get_string, parse_tree)
get_unicode = lambda val: val(context) if callable(val) else val
parts = map(get_unicode, parse_tree)
s = ''.join(parts)
return unicode(s)
......
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