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
  94142654710496["loaders.ModuleLoader"]
  94142653860608["loaders.LoaderMixin"]
  140199010283712["builtins.object"]
  94142653579104["loaders.ModuleLoader"]
  94142650643376["loaders.BaseLoader"]
  94142653860608 --> 94142654710496
  140199010283712 --> 94142653860608
  94142653579104 --> 94142654710496
  94142650643376 --> 94142653579104
  140199010283712 --> 94142650643376

🛈 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