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

Method make_module

src/jinja2/environment.py:1392–1405  ·  view source on GitHub ↗

This method works like the :attr:`module` attribute when called without arguments but it will evaluate the template on every call rather than caching it. It's also possible to provide a dict which is then used as context. The arguments are the same as for the :meth:

(
        self,
        vars: t.Optional[t.Dict[str, t.Any]] = None,
        shared: bool = False,
        locals: t.Optional[t.Mapping[str, t.Any]] = None,
    )

Source from the content-addressed store, hash-verified

1390 )
1391
1392 def make_module(
1393 self,
1394 vars: t.Optional[t.Dict[str, t.Any]] = None,
1395 shared: bool = False,
1396 locals: t.Optional[t.Mapping[str, t.Any]] = None,
1397 ) -> "TemplateModule":
1398 """This method works like the :attr:`module` attribute when called
1399 without arguments but it will evaluate the template on every call
1400 rather than caching it. It's also possible to provide
1401 a dict which is then used as context. The arguments are the same
1402 as for the :meth:`new_context` method.
1403 """
1404 ctx = self.new_context(vars, shared, locals)
1405 return TemplateModule(self, ctx)
1406
1407 async def make_module_async(
1408 self,

Callers 1

_get_default_moduleMethod · 0.95

Calls 2

new_contextMethod · 0.95
TemplateModuleClass · 0.85

Tested by

no test coverage detected