• Home
  • Raw
  • Download

Lines Matching full:environment

21 from .environment import Environment
46 system at the parser level. Custom extensions are bound to an environment
47 but may not store environment specific data on `self`. The reason for
48 this is that an extension can be bound to another environment (for
49 overlays) by creating a copy and reassigning the `environment` attribute.
51 As extensions are created by the environment they cannot accept any
55 storing the configuration values on the environment. Because this way the
56 environment ends up acting as central configuration storage the
73 def __init__(self, environment): argument
74 self.environment = environment
76 def bind(self, environment): argument
77 """Create a copy of this extension bound to another environment."""
80 rv.environment = environment
180 def __init__(self, environment): argument
181 Extension.__init__(self, environment)
182 environment.globals["_"] = _gettext_alias
183 environment.extend(
210 self.environment.newstyle_gettext = newstyle
211 if self.environment.newstyle_gettext:
214 self.environment.globals.update(gettext=gettext, ngettext=ngettext)
218 self.environment.globals.pop(key, None)
222 source = self.environment.parse(source)
320 trimmed = self.environment.policies["ext.i18n.trimmed"]
383 if not vars_referenced and not self.environment.newstyle_gettext:
407 if self.environment.newstyle_gettext:
418 # environment with autoescaping turned on
498 "filters": sorted(self.environment.filters.keys()),
499 "tests": sorted(self.environment.tests.keys()),
523 >>> from jinja2 import Environment
524 >>> env = Environment()
656 environment = Environment(
675 environment.policies["ext.i18n.trimmed"] = True
677 environment.newstyle_gettext = True
681 node = environment.parse(source)
682 tokens = list(environment.lex(environment.preprocess(source)))