-Ben
EXPR_START = "{{"
EXPR_END = "}}"
...
def _parse(reader, in_block=None):
...
if start_brace == EXPR_START:
end = reader.find(EXPR_END)
if end == -1 or reader.find("\n", 0, end) != -1:
raise ParseError("Missing end expression %s on line %d" % (EXPR_END, line))
Then the library user simply needs to do:
from tornado import template
template.EXPR_START = "{<"
template.EXPR_END = ">}"
Regards,
Cliff
--
Cliff Wells <cl...@develix.com>
if reader[curly + 1] not in ("{", "%"):
would need to become:
if reader[curly + 1] not in (EXPR_START[1], "%"):
although this construct makes me want to abstract out the entire
delimiter logic even more (to allow for variable-length delimiters and
for changing the block delimiter as well). But that's left as an
exercise for someone who actually uses this template engine (I use
Breve).
Regards,
Cliff