Commit c1718296 by Chris Jerdonek

Renamed "replacer" to "rendered".

parent 369faa88
...@@ -148,33 +148,33 @@ class Template(object): ...@@ -148,33 +148,33 @@ class Template(object):
section_key = section_key.strip() section_key = section_key.strip()
section_value = self.context.get(section_key, None) section_value = self.context.get(section_key, None)
replacer = '' rendered = ''
# Callable # Callable
if section_value and check_callable(section_value): if section_value and check_callable(section_value):
replacer = section_value(section_contents) rendered = section_value(section_contents)
# Dictionary # Dictionary
elif section_value and hasattr(section_value, 'keys') and hasattr(section_value, '__getitem__'): elif section_value and hasattr(section_value, 'keys') and hasattr(section_value, '__getitem__'):
if section_type != '^': if section_type != '^':
replacer = self._render_dictionary(section_contents, section_value) rendered = self._render_dictionary(section_contents, section_value)
# Lists # Lists
elif section_value and hasattr(section_value, '__iter__'): elif section_value and hasattr(section_value, '__iter__'):
if section_type != '^': if section_type != '^':
replacer = self._render_list(section_contents, section_value) rendered = self._render_list(section_contents, section_value)
# Other objects # Other objects
elif section_value and isinstance(section_value, object): elif section_value and isinstance(section_value, object):
if section_type != '^': if section_type != '^':
replacer = self._render_dictionary(section_contents, section_value) rendered = self._render_dictionary(section_contents, section_value)
# Falsey and Negated or Truthy and Not Negated # Falsey and Negated or Truthy and Not Negated
elif (not section_value and section_type == '^') or (section_value and section_type != '^'): elif (not section_value and section_type == '^') or (section_value and section_type != '^'):
replacer = self._render_dictionary(section_contents, section_value) rendered = self._render_dictionary(section_contents, section_value)
# Render template prior to section too # Render template prior to section too
output.append(replacer) output.append(rendered)
output = "".join(output) output = "".join(output)
return output return output
......
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