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
  94173637902128["loaders.PrefixLoader"]
  94173637890544["loaders.LoaderMixin"]
  139866058043616["builtins.object"]
  94173636342368["loaders.PrefixLoader"]
  94173636407456["loaders.BaseLoader"]
  94173637890544 --> 94173637902128
  139866058043616 --> 94173637890544
  94173636342368 --> 94173637902128
  94173636407456 --> 94173636342368
  139866058043616 --> 94173636407456

🛈 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