>>> import tempita >>> tmp = tempita.HTMLTemplate('{{asd|html}} asdasd') >>> c = tempita.bunch(asd='<12>') >>> c.default = None >>> body = tmp.substitute(c) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3/dist-packages/tempita/__init__.py", line 173, in substitute result, defs, inherit = self._interpret(ns) File "/usr/lib/python3/dist-packages/tempita/__init__.py", line 184, in _interpret self._interpret_codes(self._parsed, ns, out=parts, defs=defs) File "/usr/lib/python3/dist-packages/tempita/__init__.py", line 212, in _interpret_codes self._interpret_code(item, ns, out, defs) File "/usr/lib/python3/dist-packages/tempita/__init__.py", line 235, in _interpret_code base = func(base) TypeError: 'NoneType' object is not callable
Using hack: >>> import tempita >>> tmp = tempita.HTMLTemplate('{{asd|html}} asdasd') >>> c = tempita.bunch(asd='<12>') >>> c.default = None >>> body = tmp.substitute(c) >>> print(body) <12> asdasd
>>> import tempita HTMLTemplate( '{{asd| html}} asdasd') bunch(asd= '<12>') python3/ dist-packages/ tempita/ __init_ _.py", line 173, in substitute python3/ dist-packages/ tempita/ __init_ _.py", line 184, in _interpret _interpret_ codes(self. _parsed, ns, out=parts, defs=defs) python3/ dist-packages/ tempita/ __init_ _.py", line 212, in _interpret_codes _interpret_ code(item, ns, out, defs) python3/ dist-packages/ tempita/ __init_ _.py", line 235, in _interpret_code
>>> tmp = tempita.
>>> c = tempita.
>>> c.default = None
>>> body = tmp.substitute(c)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
result, defs, inherit = self._interpret(ns)
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
base = func(base)
TypeError: 'NoneType' object is not callable
Using hack: HTMLTemplate( '{{asd| html}} asdasd') bunch(asd= '<12>')
>>> import tempita
>>> tmp = tempita.
>>> c = tempita.
>>> c.default = None
>>> body = tmp.substitute(c)
>>> print(body)
<12> asdasd