(
self,
environment: "Environment",
parent: t.Dict[str, t.Any],
name: t.Optional[str],
blocks: t.Dict[str, t.Callable[["Context"], t.Iterator[str]]],
globals: t.Optional[t.MutableMapping[str, t.Any]] = None,
)
| 163 | """ |
| 164 | |
| 165 | def __init__( |
| 166 | self, |
| 167 | environment: "Environment", |
| 168 | parent: t.Dict[str, t.Any], |
| 169 | name: t.Optional[str], |
| 170 | blocks: t.Dict[str, t.Callable[["Context"], t.Iterator[str]]], |
| 171 | globals: t.Optional[t.MutableMapping[str, t.Any]] = None, |
| 172 | ): |
| 173 | self.parent = parent |
| 174 | self.vars: t.Dict[str, t.Any] = {} |
| 175 | self.environment: Environment = environment |
| 176 | self.eval_ctx = EvalContext(self.environment, name) |
| 177 | self.exported_vars: t.Set[str] = set() |
| 178 | self.name = name |
| 179 | self.globals_keys = set() if globals is None else set(globals) |
| 180 | |
| 181 | # create the initial mapping of blocks. Whenever template inheritance |
| 182 | # takes place the runtime will update this mapping with the new blocks |
| 183 | # from the template. |
| 184 | self.blocks = {k: [v] for k, v in blocks.items()} |
| 185 | |
| 186 | def super( |
| 187 | self, name: str, current: t.Callable[["Context"], t.Iterator[str]] |
nothing calls this directly
no test coverage detected