summaryrefslogtreecommitdiff
path: root/src/program_parser.py
diff options
context:
space:
mode:
authoruser@node5.net <user@node5.net>2026-07-05 19:33:35 +0200
committeruser@node5.net <user@node5.net>2026-07-10 13:15:02 +0200
commit61ca7e7f1abc28623e740f34f34cb8250c45e788 (patch)
tree047beb1b482ace06d100e80b3bfe3df2a5c99f4c /src/program_parser.py
parent008800522e69b89dbff73b1e55466546c1b353c7 (diff)
easter egg classes - define in python
Diffstat (limited to 'src/program_parser.py')
-rwxr-xr-xsrc/program_parser.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/program_parser.py b/src/program_parser.py
index a104ecf..5586765 100755
--- a/src/program_parser.py
+++ b/src/program_parser.py
@@ -21,7 +21,14 @@ class Event:
duration: datetime.timedelta = None
pretty: str = None
progress: float = 0
+ classes: list[str] = dataclasses.field(default_factory=list)
+specials = { # Special programs get an easter with a css class
+ 'rainbow': [ 'hello world', 'hacker jeopardy', 'goodbye world' ],
+ 'radio': ['radio'],
+ 'egg': ['æg'],
+ 'ctf': ['ctf'],
+}
class ProgramParser:
'''
@@ -68,6 +75,13 @@ class ProgramParser:
#print('Start date: ', event["start_date"])
#print("End date: ", event["end_date"])
#print()
+
+ # css classes
+ for css_class, titles in specials.items():
+ for title in titles:
+ if title in event.title.lower():
+ event.classes.append(css_class)
+
program.append(event)
program = sorted(program, key=lambda x: x.start_date)