From 353da3daf5a918c9862fe58b6b403d20d99ed2ff Mon Sep 17 00:00:00 2001 From: Ben Leslie Date: Tue, 18 Sep 2012 21:53:53 +1000 Subject: Enable defaults.DELIMITERS to be monkey-patched by module users. This updates the way in which default.DELIMITERS is used to enable simple monkey-patching should a user desire. Monkey-patching isn't the preferred approach however, it can at times be useful and it simple to support. Additionally, test cases are added to ensure certain defaults can be monkey-patched at run-time. --- pystache/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pystache/parser.py') diff --git a/pystache/parser.py b/pystache/parser.py index 4c37ec3..8b82776 100644 --- a/pystache/parser.py +++ b/pystache/parser.py @@ -7,7 +7,7 @@ Exposes a parse() function to parse template strings. import re -from pystache.defaults import DELIMITERS +from pystache import defaults from pystache.parsed import ParsedTemplate @@ -228,7 +228,7 @@ class _Parser(object): def __init__(self, delimiters=None): if delimiters is None: - delimiters = DELIMITERS + delimiters = defaults.DELIMITERS self._delimiters = delimiters -- cgit v1.2.1