Commit 8ff50e0b by Chris Jerdonek

Removed the "delims" argument from a RenderEngine method.

parent 7826ec7f
...@@ -12,6 +12,8 @@ import re ...@@ -12,6 +12,8 @@ import re
import types import types
DEFAULT_TAG_OPENING = '{{'
DEFAULT_TAG_CLOSING = '}}'
END_OF_LINE_CHARACTERS = ['\r', '\n'] END_OF_LINE_CHARACTERS = ['\r', '\n']
...@@ -103,8 +105,8 @@ class RenderEngine(object): ...@@ -103,8 +105,8 @@ class RenderEngine(object):
tag_re = None tag_re = None
otag = '{{' otag = DEFAULT_TAG_OPENING
ctag = '}}' ctag = DEFAULT_TAG_CLOSING
def __init__(self, load_partial=None, literal=None, escape=None): def __init__(self, load_partial=None, literal=None, escape=None):
""" """
...@@ -270,12 +272,13 @@ class RenderEngine(object): ...@@ -270,12 +272,13 @@ class RenderEngine(object):
return ''.join(parts) return ''.join(parts)
return func return func
def parse_string_to_tree(self, template_string, delims=('{{', '}}')): def parse_string_to_tree(self, template_string, delims=None):
engine = RenderEngine(load_partial=self.load_partial, literal=self.literal, escape=self.escape) engine = RenderEngine(load_partial=self.load_partial, literal=self.literal, escape=self.escape)
engine.otag = delims[0] if delims is not None:
engine.ctag = delims[1] engine.otag = delims[0]
engine.ctag = delims[1]
engine._compile_regexps() engine._compile_regexps()
...@@ -376,7 +379,7 @@ class RenderEngine(object): ...@@ -376,7 +379,7 @@ class RenderEngine(object):
return end_index return end_index
def render_template(self, template, context, delims=('{{', '}}')): def render_template(self, template, context):
""" """
Arguments: Arguments:
...@@ -387,6 +390,6 @@ class RenderEngine(object): ...@@ -387,6 +390,6 @@ class RenderEngine(object):
if type(template) is not unicode: if type(template) is not unicode:
raise Exception("Argument 'template' not unicode: %s: %s" % (type(template), repr(template))) raise Exception("Argument 'template' not unicode: %s: %s" % (type(template), repr(template)))
parse_tree = self.parse_string_to_tree(template_string=template, delims=delims) parse_tree = self.parse_string_to_tree(template_string=template)
return render_parse_tree(parse_tree, context, template) return render_parse_tree(parse_tree, context, template)
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