aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/common_jinja_templates.py
blob: 732db41f91e32a4c0bb27a1b859c78fba7b462d1 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# SPDX-License-Identifier: CC0-1.0

# Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>
#
# Available under the terms of Creative Commons Zero v1.0 Universal.

import typing as t

from jinja2 import PackageLoader, ChoiceLoader, BaseLoader


def loader() -> BaseLoader:
    return PackageLoader(__package__, package_path='common_jinja_templates')

def combine_with_loaders(loaders: t.Iterable[BaseLoader]) -> BaseLoader:
    return ChoiceLoader([loader(), *loaders])