Create a new :class:`Context` for this template. The vars provided will be passed to the template. Per default the globals are added to the context. If shared is set to `True` the data is passed as is to the context without adding the globals. `locals` can be a di
(
self,
vars: t.Optional[t.Dict[str, t.Any]] = None,
shared: bool = False,
locals: t.Optional[t.Mapping[str, t.Any]] = None,
)
| 1373 | yield self.environment.handle_exception() |
| 1374 | |
| 1375 | def new_context( |
| 1376 | self, |
| 1377 | vars: t.Optional[t.Dict[str, t.Any]] = None, |
| 1378 | shared: bool = False, |
| 1379 | locals: t.Optional[t.Mapping[str, t.Any]] = None, |
| 1380 | ) -> Context: |
| 1381 | class="st">"""Create a new :class:`Context` for this template. The vars |
| 1382 | provided will be passed to the template. Per default the globals |
| 1383 | are added to the context. If shared is set to `True` the data |
| 1384 | is passed as is to the context without adding the globals. |
| 1385 | |
| 1386 | `locals` can be a dict of local variables for internal usage. |
| 1387 | class="st">""" |
| 1388 | return new_context( |
| 1389 | self.environment, self.name, self.blocks, vars, shared, self.globals, locals |
| 1390 | ) |
| 1391 | |
| 1392 | def make_module( |
| 1393 | self, |
no test coverage detected