minor renames

This commit is contained in:
Jörn-Michael Miehe 2023-09-12 17:22:52 +00:00
parent 8290925659
commit 0550621835
2 changed files with 10 additions and 10 deletions

View file

@ -11,7 +11,7 @@ from .helpers import Random, list_images_auto, load_image, set_len
from .webdav import WebDAV from .webdav import WebDAV
async def get_days( async def get_all_days(
cal_cfg: CalendarConfig = Depends(get_calendar_config), cal_cfg: CalendarConfig = Depends(get_calendar_config),
) -> list[int]: ) -> list[int]:
""" """
@ -21,9 +21,9 @@ async def get_days(
return sorted(set(door.day for door in cal_cfg.doors)) 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), cfg: Config = Depends(get_config),
days: list[int] = Depends(get_days), days: list[int] = Depends(get_all_days),
) -> dict[int, str]: ) -> dict[int, str]:
""" """
Lösung auf vorhandene Tage aufteilen Lösung auf vorhandene Tage aufteilen
@ -48,7 +48,7 @@ async def get_parts(
async def get_day_part( async def get_day_part(
day: int, day: int,
parts: dict[int, str] = Depends(get_parts), parts: dict[int, str] = Depends(get_all_parts),
) -> str: ) -> str:
""" """
Heute angezeigter Teil der Lösung Heute angezeigter Teil der Lösung
@ -57,8 +57,8 @@ async def get_day_part(
return parts[day] return parts[day]
async def get_auto_image_names( async def get_all_auto_image_names(
days: list[int] = Depends(get_days), days: list[int] = Depends(get_all_days),
images: list[str] = Depends(list_images_auto), images: list[str] = Depends(list_images_auto),
) -> dict[int, str]: ) -> dict[int, str]:
""" """
@ -74,7 +74,7 @@ async def get_auto_image_names(
async def gen_day_auto_image( async def gen_day_auto_image(
day: int, day: int,
cfg: Config = Depends(get_config), 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), day_part: str = Depends(get_day_part),
) -> Image.Image: ) -> Image.Image:
""" """
@ -106,7 +106,7 @@ async def gen_day_auto_image(
async def get_day_image( async def get_day_image(
day: int, day: int,
cfg: Config = Depends(get_config), 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), day_part: str = Depends(get_day_part),
) -> Image.Image: ) -> Image.Image:
""" """

View file

@ -5,7 +5,7 @@ from pydantic import BaseModel
from ..core.calendar_config import CalendarConfig, DoorsSaved, get_calendar_config from ..core.calendar_config import CalendarConfig, DoorsSaved, get_calendar_config
from ..core.config import Config, get_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 ..core.settings import SETTINGS
from ._security import require_admin, user_is_admin from ._security import require_admin, user_is_admin
@ -96,7 +96,7 @@ class DayStrModel(BaseModel):
@router.get("/day_parts") @router.get("/day_parts")
async def get_day_parts( async def get_day_parts(
_: None = Depends(require_admin), _: None = Depends(require_admin),
parts: dict[int, str] = Depends(get_parts), parts: dict[int, str] = Depends(get_all_parts),
) -> list[DayStrModel]: ) -> list[DayStrModel]:
""" """
Zuordnung der Lösungsteile zu den Tagen Zuordnung der Lösungsteile zu den Tagen