Source code for feriennet.sponsors

import time
import yaml

from pathlib import Path
from onegov.core.static import StaticFile


from typing import overload, Any, TYPE_CHECKING
if TYPE_CHECKING:
    from onegov.feriennet.request import FeriennetRequest
    from typing import Self


[docs] def load_sponsors(sponsors_path: str) -> list['Sponsor']: root = Path(sponsors_path) with (root / 'sponsors.yml').open('r') as f: return [Sponsor(**sponsor) for sponsor in yaml.safe_load(f)]
# FIXME: This isn't particularly type safe, we should try to do better