Skip to content

ModuleLoader

Base classes

Name Children Inherits
LoaderMixin
jinjarope.loaders
Loader mixin which allows to OR loaders into a choice loader.
ModuleLoader
jinja2.loaders
This loader loads templates from precompiled templates.

⋔ Inheritance diagram

graph TD
  94173637903120["loaders.ModuleLoader"]
  94173637890544["loaders.LoaderMixin"]
  139866058043616["builtins.object"]
  94173636256752["loaders.ModuleLoader"]
  94173636407456["loaders.BaseLoader"]
  94173637890544 --> 94173637903120
  139866058043616 --> 94173637890544
  94173636256752 --> 94173637903120
  94173636407456 --> 94173636256752
  139866058043616 --> 94173636407456

🛈 DocStrings

Bases: LoaderMixin, ModuleLoader

This loader loads templates from precompiled templates.

Templates can be precompiled with :meth:Environment.compile_templates.

Source code in src/jinjarope/loaders.py
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
class ModuleLoader(LoaderMixin, jinja2.ModuleLoader):
    """This loader loads templates from precompiled templates.

    Templates can be precompiled with :meth:`Environment.compile_templates`.
    """

    ID = "module"

    def __repr__(self):
        return utils.get_repr(self, path=self.module.__path__)

    def __eq__(self, other):
        return (
            type(self) is type(other)
            and self.package_name == other.package_name
            and self.module == other.module
        )

    def __hash__(self):
        return hash(self.package_name) + hash(self.module)

Show source on GitHub