From 0550621835d52ac0143b1f34e40b595e6492f08f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Tue, 12 Sep 2023 17:22:52 +0000 Subject: [PATCH] minor renames --- api/advent22_api/core/depends.py | 16 ++++++++-------- api/advent22_api/routers/admin.py | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/advent22_api/core/depends.py b/api/advent22_api/core/depends.py index b97d6dc..c3fb90a 100644 --- a/api/advent22_api/core/depends.py +++ b/api/advent22_api/core/depends.py @@ -11,7 +11,7 @@ from .helpers import Random, list_images_auto, load_image, set_len from .webdav import WebDAV -async def get_days( +async def get_all_days( cal_cfg: CalendarConfig = Depends(get_calendar_config), ) -> list[int]: """ @@ -21,9 +21,9 @@ async def get_days( return sorted(set(door.day for door in cal_cfg.doors)) -async def get_parts( +async def get_all_parts( cfg: Config = Depends(get_config), - days: list[int] = Depends(get_days), + days: list[int] = Depends(get_all_days), ) -> dict[int, str]: """ Lösung auf vorhandene Tage aufteilen @@ -48,7 +48,7 @@ async def get_parts( async def get_day_part( day: int, - parts: dict[int, str] = Depends(get_parts), + parts: dict[int, str] = Depends(get_all_parts), ) -> str: """ Heute angezeigter Teil der Lösung @@ -57,8 +57,8 @@ async def get_day_part( return parts[day] -async def get_auto_image_names( - days: list[int] = Depends(get_days), +async def get_all_auto_image_names( + days: list[int] = Depends(get_all_days), images: list[str] = Depends(list_images_auto), ) -> dict[int, str]: """ @@ -74,7 +74,7 @@ async def get_auto_image_names( async def gen_day_auto_image( day: int, cfg: Config = Depends(get_config), - auto_image_names: list[str] = Depends(get_auto_image_names), + auto_image_names: list[str] = Depends(get_all_auto_image_names), day_part: str = Depends(get_day_part), ) -> Image.Image: """ @@ -106,7 +106,7 @@ async def gen_day_auto_image( async def get_day_image( day: int, cfg: Config = Depends(get_config), - auto_image_names: list[str] = Depends(get_auto_image_names), + auto_image_names: list[str] = Depends(get_all_auto_image_names), day_part: str = Depends(get_day_part), ) -> Image.Image: """ diff --git a/api/advent22_api/routers/admin.py b/api/advent22_api/routers/admin.py index 100787c..b88ae72 100644 --- a/api/advent22_api/routers/admin.py +++ b/api/advent22_api/routers/admin.py @@ -5,7 +5,7 @@ from pydantic import BaseModel from ..core.calendar_config import CalendarConfig, DoorsSaved, get_calendar_config from ..core.config import Config, get_config -from ..core.depends import get_parts +from ..core.depends import get_all_parts from ..core.settings import SETTINGS from ._security import require_admin, user_is_admin @@ -96,7 +96,7 @@ class DayStrModel(BaseModel): @router.get("/day_parts") async def get_day_parts( _: None = Depends(require_admin), - parts: dict[int, str] = Depends(get_parts), + parts: dict[int, str] = Depends(get_all_parts), ) -> list[DayStrModel]: """ Zuordnung der Lösungsteile zu den Tagen