• Home
  • Raw
  • Download

Lines Matching full:environment

62 _env_bound = t.TypeVar("_env_bound", bound="Environment")
68 """Return a new spontaneous environment. A spontaneous environment
70 existing environment.
72 :param cls: Environment class to create.
73 :param args: Positional arguments passed to environment.
107 environment: "Environment", argument
110 """Load the extensions from the list and bind it to the environment.
119 result[extension.identifier] = extension(environment)
124 def _environment_config_check(environment: "Environment") -> "Environment": argument
125 """Perform a sanity check on the environment."""
127 environment.undefined, Undefined
130 environment.block_start_string
131 != environment.variable_start_string
132 != environment.comment_start_string
134 assert environment.newline_sequence in {
139 return environment
142 class Environment: class
143 r"""The core component of Jinja is the `Environment`. It contains
232 The template loader for this environment.
264 #: if this environment is sandboxed. Modifying this variable won't make
265 #: the environment sandboxed though. For a real sandboxed environment
270 #: True if the environment is just an overlay
273 #: the environment this environment is linked to if it is an overlay
274 linked_to: t.Optional["Environment"] = None
276 #: shared environments have this set to `True`. A shared environment
369 """Adds an extension after the environment was created.
376 """Add the items to the instance of the environment if they do not exist
408 ) -> "Environment":
409 """Create a new overlay environment that shares all the data with the
410 current environment except for cache and the overridden attributes.
411 Extensions cannot be removed for an overlayed environment. An overlayed
412 environment automatically gets all the extensions of the environment it
415 Creating overlays should happen after the initial environment was set
417 copied over so modifications on the original environment may not shine
454 """The lexer for this environment."""
542 elif pass_arg is _PassArg.environment:
559 environment in async mode and the filter supports async
580 environment in async mode and the test supports async execution.
751 environment variable to be set.
782 >>> env = Environment()
898 """Returns a list of templates for this environment. This requires
955 raise TypeError("no loader for this environment specified")
963 # affect the template, not the environment globals.
992 :param globals: Extend the environment :attr:`globals` with
1027 :param globals: Extend the environment :attr:`globals` with
1096 :param globals: Extend the environment :attr:`globals` with
1111 globals overlay the environment :attr:`globals`.
1115 changes to the environment's globals are still reflected.
1122 environment globals.
1133 Use the methods on :class:`Environment` to create or load templates.
1134 The environment is used to configure how templates are compiled and
1139 arguments as :class:`Environment`. All templates created with the
1140 same environment arguments share the same ephemeral ``Environment``
1147 #: Type of environment to create when creating a template directly
1148 #: rather than through an existing environment.
1149 environment_class: t.Type[Environment] = Environment
1151 environment: Environment
1213 environment: Environment, argument
1219 is used by the loaders and environment to create a template object.
1221 namespace = {"environment": environment, "__file__": code.co_filename}
1223 rv = cls._from_namespace(environment, namespace, globals)
1230 environment: Environment, argument
1239 return cls._from_namespace(environment, module_dict, globals)
1244 environment: Environment, argument
1249 t.environment = environment
1264 namespace["environment"] = environment
1279 if self.environment.is_async:
1299 return self.environment.concat(self.root_render_func(ctx)) # type: ignore
1301 self.environment.handle_exception()
1312 if not self.environment.is_async:
1314 "The environment was not created with async mode enabled."
1320 return self.environment.concat( # type: ignore
1324 return self.environment.handle_exception()
1340 if self.environment.is_async:
1354 yield self.environment.handle_exception()
1362 if not self.environment.is_async:
1364 "The environment was not created with async mode enabled."
1373 yield self.environment.handle_exception()
1389 self.environment, self.name, self.blocks, vars, shared, self.globals, locals
1436 if self.environment.is_async:
1528 if context.environment.is_async:
1556 """The :meth:`jinja2.Environment.compile_expression` method returns an
1667 Environment.template_class = Template