[Fix] typo and locations

This commit is contained in:
coja
2026-06-22 16:47:27 +02:00
parent 3906aef068
commit e63f6a85be
2 changed files with 14 additions and 7 deletions
+1 -1
View File
@@ -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")
+13 -6
View File
@@ -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-->", date)
event_template = event_template.replace("<!--TITLE-->", title)
event_template = event_template.replace("<!--URL-->", url)
if location.startswith("DC Krov"):
event_template = event_template.replace("<!--LOCATION-->", "DC Krov\\, Kraljice Marije 47\\, 6\\, Beograd\\, Serbia")
elif location.startswith("Matematički fakultet (Učionica 153)"):
event_template = event_template.replace("<!--LOCATION-->", "Matematički fakultet\\, Svetog Nikole 39\\, Beograd\\, Serbia")
else:
event_template = event_template.replace("<!--LOCATION-->", 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("<!--LOCATION-->", ical_location)
events_ical += event_template