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
  94142655683136["loaders.ChoiceLoader"]
  94142653860608["loaders.LoaderMixin"]
  140199010283712["builtins.object"]
  94142653576336["loaders.ChoiceLoader"]
  94142650643376["loaders.BaseLoader"]
  94142653860608 --> 94142655683136
  140199010283712 --> 94142653860608
  94142653576336 --> 94142655683136
  94142650643376 --> 94142653576336
  140199010283712 --> 94142650643376

🛈 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