Commit 9c2048a1 by Chris Jerdonek

Removed call() function.

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