diff --git a/image_poster.py b/image_poster.py index 269d2d0..635a580 100755 --- a/image_poster.py +++ b/image_poster.py @@ -11,7 +11,7 @@ from cairosvg import svg2png CURRENT_TIME = dt.date.today() NEXT_MONTH = CURRENT_TIME + relativedelta.relativedelta(months=1, day=1) DAYS_OF_WEEK_SR = ("PON", "UTO", "SRE", "ČET", "PET", "SUB", "NED") -DAYS_OF_WEEK_EN = ("MON", "TUE", "WED", "THU", "FRI", "SAT", "SUn") +DAYS_OF_WEEK_EN = ("MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN") MONTHS_SR = ("Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar") diff --git a/prep.py b/prep.py index 2171a92..ce71858 100755 --- a/prep.py +++ b/prep.py @@ -5,6 +5,13 @@ from datetime import datetime DAYS_SR = ["PON", "UTO", "SRE", "ČET", "PET", "SUB", "NED"] DAYS_EN = ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"] +ICAL_LOCATION_ADDRESSES = { + "Xecut": "XECUT\\, Jovana Ćirilova 15\\, Local 3\\, Beograd\\, Serbia", + "Matematički fakultet (Učionica JAG2)": "Matematički fakultet (JAG2)\\, Vatroslava Jagića 5\\, Beograd\\, Serbia", + "Matematički fakultet (Učionica JAG3)": "Matematički fakultet (JAG3)\\, Vatroslava Jagića 5\\, Beograd\\, Serbia", + "Matematički fakultet (Učionica 153)": "Matematički fakultet\\, Svetog Nikole 39\\, Beograd\\, Serbia", +} + TYPES_DICT = { "hack": ("hakaton", "hackathon"), "lecture": ("predavanje", "lecture"), @@ -104,12 +111,12 @@ def build_ical(events: list[dict]) -> str: event_template = event_template.replace("", date) event_template = event_template.replace("", title) event_template = event_template.replace("", url) - if location.startswith("DC Krov"): - event_template = event_template.replace("", "DC Krov\\, Kraljice Marije 47\\, 6\\, Beograd\\, Serbia") - elif location.startswith("Matematički fakultet (Učionica 153)"): - event_template = event_template.replace("", "Matematički fakultet\\, Svetog Nikole 39\\, Beograd\\, Serbia") - else: - event_template = event_template.replace("", location) + ical_location = location + for prefix, address in ICAL_LOCATION_ADDRESSES.items(): + if location.startswith(prefix): + ical_location = address + break + event_template = event_template.replace("", ical_location) events_ical += event_template