aboutsummaryrefslogtreecommitdiff
path: root/lessons.py
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-04-05 16:28:36 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2023-04-05 16:28:36 +0200
commitf61b34dbdb4b987359b6fb6543b942c799ac350e (patch)
tree75e809319b5bc75e1f6d827c6f3d90ccd6fe2022 /lessons.py
parent097fe1e21e9d73cd492b2c4ad718f99b04fe40cf (diff)
downloadavail-lessons-f61b34dbdb4b987359b6fb6543b942c799ac350e.tar.gz
avail-lessons-f61b34dbdb4b987359b6fb6543b942c799ac350e.zip
detect end of classes prior to a lesson
Diffstat (limited to 'lessons.py')
-rwxr-xr-xlessons.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lessons.py b/lessons.py
index 0ff3280..cf0dec9 100755
--- a/lessons.py
+++ b/lessons.py
@@ -83,6 +83,9 @@ def format_period(period: webuntis.objects.PeriodObject,
period_evs = [
ev for ev in evs if
ev.start.timestamp() <= period.start.timestamp() <= ev.end.timestamp()
+ # Detect early end of classes
+ or (ev.summary == 'Unterrichtsschluss' and ev.start.date() == date
+ and ev.start.timestamp() <= period.start.timestamp())
]
if period_evs:
for event in period_evs: