Skip to content

PrefixLoader

Base classes

Name Children Inherits
LoaderMixin
jinjarope.loaders
Loader mixin which allows to OR loaders into a choice loader.
PrefixLoader
jinja2.loaders
A loader that is passed a dict of loaders where each loader is bound

⋔ Inheritance diagram

graph TD
  94142654709504["loaders.PrefixLoader"]
  94142653860608["loaders.LoaderMixin"]
  140199010283712["builtins.object"]
  94142652362016["loaders.PrefixLoader"]
  94142650643376["loaders.BaseLoader"]
  94142653860608 --> 94142654709504
  140199010283712 --> 94142653860608
  94142652362016 --> 94142654709504
  94142650643376 --> 94142652362016
  140199010283712 --> 94142650643376

🛈 DocStrings

Bases: LoaderMixin, PrefixLoader

A loader for prefixing other loaders.

Source code in src/jinjarope/loaders.py
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
class PrefixLoader(LoaderMixin, jinja2.PrefixLoader):
    """A loader for prefixing other loaders."""

    ID = "prefix"

    def __repr__(self):
        return utils.get_repr(self, self.mapping)

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

    def __hash__(self):
        return hash(tuple(sorted(self.mapping.items())))

    def __bool__(self):
        return bool(self.mapping)

    def __iter__(self):
        return iter(self.mapping)

Show source on GitHub