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

Method load

src/jinja2/loaders.py:546–558  ·  view source on GitHub ↗
(
        self,
        environment: "Environment",
        name: str,
        globals: t.Optional[t.MutableMapping[str, t.Any]] = None,
    )

Source from the content-addressed store, hash-verified

544
545 @internalcode
546 def load(
547 self,
548 environment: "Environment",
549 name: str,
550 globals: t.Optional[t.MutableMapping[str, t.Any]] = None,
551 ) -> "Template":
552 loader, local_name = self.get_loader(name)
553 try:
554 return loader.load(environment, local_name, globals)
555 except TemplateNotFound as e:
556 # re-raise the exception with the correct filename here.
557 # (the one that includes the prefix)
558 raise TemplateNotFound(name) from e
559
560 def list_templates(self) -> t.List[str]:
561 result = []

Callers

nothing calls this directly

Calls 3

get_loaderMethod · 0.95
TemplateNotFoundClass · 0.85
loadMethod · 0.45

Tested by

no test coverage detected