Lines Matching refs:globals
145 globals and others. Instances of this class may be modified if
351 self.globals = DEFAULT_NAMESPACE.copy()
952 self, name: str, globals: t.Optional[t.MutableMapping[str, t.Any]]
962 # template.globals is a ChainMap, modifying it will only
963 # affect the template, not the environment globals.
964 if globals:
965 template.globals.update(globals)
969 template = self.loader.load(self, name, self.make_globals(globals))
980 globals: t.Optional[t.MutableMapping[str, t.Any]] = None,
992 :param globals: Extend the environment :attr:`globals` with
995 cached, its globals are updated with any new items.
998 If a template is loaded from cache, ``globals`` will update
999 the template's globals instead of ignoring the new values.
1010 return self._load_template(name, globals)
1017 globals: t.Optional[t.MutableMapping[str, t.Any]] = None,
1027 :param globals: Extend the environment :attr:`globals` with
1030 cached, its globals are updated with any new items.
1033 If a template is loaded from cache, ``globals`` will update
1034 the template's globals instead of ignoring the new values.
1061 return self._load_template(name, globals)
1073 globals: t.Optional[t.MutableMapping[str, t.Any]] = None,
1081 return self.get_template(template_name_or_list, parent, globals)
1084 return self.select_template(template_name_or_list, parent, globals)
1089 globals: t.Optional[t.MutableMapping[str, t.Any]] = None,
1096 :param globals: Extend the environment :attr:`globals` with
1099 cached, its globals are updated with any new items.
1103 gs = self.make_globals(globals)
1110 """Make the globals map for a template. Any given template
1111 globals overlay the environment :attr:`globals`.
1114 to a template's globals to only affect that template, while
1115 changes to the environment's globals are still reflected.
1116 However, avoid modifying any globals after a template is loaded.
1118 :param d: Dict of template-specific globals.
1122 environment globals.
1127 return ChainMap(d, self.globals)
1152 globals: t.MutableMapping[str, t.Any]
1215 globals: t.MutableMapping[str, t.Any],
1218 """Creates a template object from compiled code and the globals. This
1223 rv = cls._from_namespace(environment, namespace, globals)
1232 globals: t.MutableMapping[str, t.Any],
1239 return cls._from_namespace(environment, module_dict, globals)
1246 globals: t.MutableMapping[str, t.Any],
1250 t.globals = globals
1382 provided will be passed to the template. Per default the globals
1384 is passed as is to the context without adding the globals.
1389 self.environment, self.name, self.blocks, vars, shared, self.globals, locals
1427 template's globals by default, but they can only be accessed via
1430 If there are new globals, we need to create a new module because
1432 to globals from the current context. This new module is not
1434 should have access to only the current template's globals.
1440 keys = ctx.globals_keys - self.globals.keys()
1454 keys = ctx.globals_keys - self.globals.keys()