chage incorrect filenames in prep.py

This commit is contained in:
fram3d 2023-08-04 19:16:46 +02:00
parent f3e3abf97b
commit 234c0d576a
Signed by: fram3d
GPG Key ID: 938920E709EEA32A

10
prep.py
View File

@ -48,7 +48,7 @@ def is_past_event(event):
def load_events():
events = []
with open("dogadjaji.txt", "rt") as file:
with open("dogadjaji.csv", "rt") as file:
file.readline()
for event in file.readlines():
event = event.strip()
@ -57,7 +57,7 @@ def load_events():
return events
def write_events(events):
with open("dogadjaji.txt", "wt") as file:
with open("dogadjaji.csv", "wt") as file:
file.write("datum, vreme, lokacija, tema\n")
for event in events:
file.write(event+"\n")
@ -100,7 +100,7 @@ for event in future_events:
events.append(end)
with open("pages/dogadjaji.html","rt") as file:
with open("pages/events.html","rt") as file:
html = file.readlines()
new_html = []
@ -126,5 +126,5 @@ while i<len(html):
i+=1
with open("pages/dogadjaji.html","wt") as file:
file.writelines(new_html)
with open("pages/events.html","wt") as file:
file.writelines(new_html)