summaryrefslogtreecommitdiff
path: root/src/program_parser.py
diff options
context:
space:
mode:
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)