Lines Matching full:environment
21 from jinja2.environment import Environment
45 system at the parser level. Custom extensions are bound to an environment
46 but may not store environment specific data on `self`. The reason for
47 this is that an extension can be bound to another environment (for
48 overlays) by creating a copy and reassigning the `environment` attribute.
50 As extensions are created by the environment they cannot accept any
54 storing the configuration values on the environment. Because this way the
55 environment ends up acting as central configuration storage the
72 def __init__(self, environment): argument
73 self.environment = environment
75 def bind(self, environment): argument
76 """Create a copy of this extension bound to another environment."""
79 rv.environment = environment
169 def __init__(self, environment): argument
170 Extension.__init__(self, environment)
171 environment.globals['_'] = _gettext_alias
172 environment.extend(
199 self.environment.newstyle_gettext = newstyle
200 if self.environment.newstyle_gettext:
203 self.environment.globals.update(
210 self.environment.globals.pop(key, None)
214 source = self.environment.parse(source)
307 trimmed = self.environment.policies['ext.i18n.trimmed']
362 if not vars_referenced and not self.environment.newstyle_gettext:
385 if self.environment.newstyle_gettext:
396 # environment with autoescaping turned on
452 >>> from jinja2 import Environment
453 >>> env = Environment()
584 environment = Environment(
603 environment.policies['ext.i18n.trimmed'] = True
605 environment.newstyle_gettext = True
609 node = environment.parse(source)
610 tokens = list(environment.lex(environment.preprocess(source)))