Skip to content

ChoiceLoader

Base classes

Name Children Inherits
LoaderMixin
jinjarope.loaders
Loader mixin which allows to OR loaders into a choice loader.
ChoiceLoader
jinja2.loaders
This loader works like the `PrefixLoader` just that no prefix is

⋔ Inheritance diagram

graph TD
  94173637974896["loaders.ChoiceLoader"]
  94173637890544["loaders.LoaderMixin"]
  139866058043616["builtins.object"]
  94173636502256["loaders.ChoiceLoader"]
  94173636407456["loaders.BaseLoader"]
  94173637890544 --> 94173637974896
  139866058043616 --> 94173637890544
  94173636502256 --> 94173637974896
  94173636407456 --> 94173636502256
  139866058043616 --> 94173636407456

🛈 DocStrings

Bases: LoaderMixin, ChoiceLoader

A loader which combines multiple other loaders.

Source code in src/jinjarope/loaders.py
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
class ChoiceLoader(LoaderMixin, jinja2.ChoiceLoader):
    """A loader which combines multiple other loaders."""

    ID = "choice"

    def __repr__(self):
        return utils.get_repr(self, loaders=self.loaders)

    def __bool__(self):
        return len(self.loaders) > 0

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

    def __hash__(self):
        return hash(tuple(self.loaders))

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

Show source on GitHub