Skip to content

Commit

Permalink
Allow ANY as type of event science (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaksia authored Jan 25, 2024
1 parent 0629f8d commit 8eb2b7a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
EventScience.FYZ: "FYZ",
EventScience.INF: "INF",
EventScience.OTHER: "iné",
EventScience.ANY: "všetky",
}
}

Expand All @@ -65,7 +66,6 @@
dataset = kkapi.get_current_dataset()
print(PREFIX_OK, f"Using school year {dataset.school_year} as data source.", file=sys.stderr)


# Load JSON data.
events = kkapi.get_events(dataset)
print(PREFIX_WORK, "Generating iCal file...", file=sys.stderr)
Expand Down Expand Up @@ -113,6 +113,9 @@ def science_filter(args):
def filter(event):
if args == ["any"]:
return True

if event.sciences == [EventScience.ANY]:
return True

for science in args:
if EventScience(science) in event.sciences:
Expand Down

0 comments on commit 8eb2b7a

Please sign in to comment.