• Home
  • Raw
  • Download

Lines Matching full:environment

19 from jinja2.environment import Environment
43 system at the parser level. Custom extensions are bound to an environment
44 but may not store environment specific data on `self`. The reason for
45 this is that an extension can be bound to another environment (for
46 overlays) by creating a copy and reassigning the `environment` attribute.
48 As extensions are created by the environment they cannot accept any
52 storing the configuration values on the environment. Because this way the
53 environment ends up acting as central configuration storage the
70 def __init__(self, environment): argument
71 self.environment = environment
73 def bind(self, environment): argument
74 """Create a copy of this extension bound to another environment."""
77 rv.environment = environment
167 def __init__(self, environment): argument
168 Extension.__init__(self, environment)
169 environment.globals['_'] = _gettext_alias
170 environment.extend(
197 self.environment.newstyle_gettext = newstyle
198 if self.environment.newstyle_gettext:
201 self.environment.globals.update(
208 self.environment.globals.pop(key, None)
212 source = self.environment.parse(source)
346 if not vars_referenced and not self.environment.newstyle_gettext:
369 if self.environment.newstyle_gettext:
380 # environment with autoescaping turned on
463 >>> from jinja2 import Environment
464 >>> env = Environment()
595 environment = Environment(
614 environment.newstyle_gettext = True
618 node = environment.parse(source)
619 tokens = list(environment.lex(environment.preprocess(source)))