diff --git a/myice/myice.py b/myice/myice.py index 30fda3b..e9639f5 100755 --- a/myice/myice.py +++ b/myice/myice.py @@ -31,6 +31,7 @@ class AgeGroup(str, Enum): u13p = "U13 (Prép)" u15t = "U15 (Top)" u15a = "U15 (A)" + u111 = "U11 (1)" class EventType(str, Enum): @@ -141,13 +142,13 @@ def wrapper_session(func): @wrapper_session -def get_schedule() -> str: +def get_schedule(num_days: int) -> str: global session global userid assert session and userid now = datetime.datetime.now() date_start = now - date_end = date_start + datetime.timedelta(days=7) + date_end = date_start + datetime.timedelta(days=num_days) r = session.post( "https://app.myice.hockey/inc/processclubplanning.php", data={ @@ -208,11 +209,12 @@ def schedule( "--outfile", "-o", help="file to write result to, or stdout if none" ), ] = None, + num_days: Annotated[int, typer.Option("--days")] = 7, ): """ Fetch schedule as json """ - schedule = get_schedule() + schedule = get_schedule(num_days) if outfile: with outfile.open("w") as f: f.write(schedule)