Commit d95b5e9c by Chris Jerdonek
parent 17d73cdf
......@@ -189,8 +189,15 @@ class ContextStack(object):
value = self.get(parts[0], _NOT_FOUND)
# The full context stack is not used to resolve the remaining parts.
# From the spec--
#
# If any name parts were retained in step 1, each should be resolved
# against a context stack containing only the result from the former
# resolution.
#
for part in parts[1:]:
# TODO: use EAFP here instead.
# TODO: consider using EAFP here instead.
# http://docs.python.org/glossary.html#term-eafp
if value is _NOT_FOUND:
break
......@@ -203,6 +210,7 @@ class ContextStack(object):
return value
# TODO: rename this method _get_part().
def get(self, key, default=None):
"""
Query the stack for the given key, and return the resulting value.
......
......@@ -135,7 +135,7 @@ class RenderEngine(object):
"""
# TODO: is there a bug because we are not using the same
# logic as in _get_string_value()?
data = context.get(name)
data = context.resolve(name)
# Per the spec, lambdas in inverted sections are considered truthy.
if data:
return u''
......@@ -154,7 +154,7 @@ class RenderEngine(object):
"""
template = template_
parsed_template = parsed_template_
data = context.get(name)
data = context.resolve(name)
# From the spec:
#
......
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