MCPcopy
hub / github.com/pallets/jinja / __init__

Method __init__

src/jinja2/runtime.py:165–184  ·  view source on GitHub ↗
(
        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,
    )

Source from the content-addressed store, hash-verified

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]]

Callers

nothing calls this directly

Calls 2

EvalContextClass · 0.85
itemsMethod · 0.80

Tested by

no test coverage detected