import jinja2
from werkzeug import script
-env = jinja2.Environment()
+env = jinja2.Environment(extensions=['jinja2.ext.i18n'])
def shell_init_func():
def _compile(x):
raise CompilerExit()
self.outdent()
- self.writeline('parent_template = environment.get_template(', node, 1)
+ self.writeline('parent_template = environment.get_template(', node)
self.visit(node.template, frame)
self.write(', %r)' % self.name)
self.writeline('for name, parent_block in parent_template.'
class Extension(object):
"""Extensions can be used to add extra functionality to the Jinja template
- system at the parser level. This is a supported but currently
- undocumented interface. Custom extensions are bound to an environment but
- may not store environment specific data on `self`. The reason for this is
- that an extension can be bound to another environment (for overlays) by
- creating a copy and reassigning the `environment` attribute.
+ system at the parser level. Custom extensions are bound to an environment
+ but may not store environment specific data on `self`. The reason for
+ this is that an extension can be bound to another environment (for
+ overlays) by creating a copy and reassigning the `environment` attribute.
As extensions are created by the environment they cannot accept any
arguments for configuration. One may want to work around that by using