Skip to content

Commit

Permalink
Rename some functions to make the explanation clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed May 8, 2014
1 parent c068964 commit 071b961
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions template-engine/templite.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def __init__(self, text, *contexts):
# it, and execute it to render the template.
code = CodeBuilder()

code.add_line("def render(ctx, dot):")
code.add_line("def render_function(ctx, do_dots):")
code.indent()
vars_code = code.add_subbuilder()
code.add_line("result = []")
Expand Down Expand Up @@ -191,7 +191,7 @@ def flush_output():

code.add_line("return ''.join(result)")
code.dedent()
self._render_function = code.get_globals()['render']
self._render_function = code.get_globals()['render_function']

def _expr_code(self, expr):
"""Generate a Python expression for `expr`."""
Expand All @@ -205,7 +205,7 @@ def _expr_code(self, expr):
dots = expr.split(".")
code = self._expr_code(dots[0])
args = ", ".join(repr(d) for d in dots[1:])
code = "dot(%s, %s)" % (code, args)
code = "do_dots(%s, %s)" % (code, args)
else:
self._variable(expr, self.all_vars)
code = "c_%s" % expr
Expand Down

0 comments on commit 071b961

Please sign in to comment.