chage incorrect filenames in prep.py
This commit is contained in:
parent
f3e3abf97b
commit
234c0d576a
10
prep.py
10
prep.py
@ -48,7 +48,7 @@ def is_past_event(event):
|
|||||||
|
|
||||||
def load_events():
|
def load_events():
|
||||||
events = []
|
events = []
|
||||||
with open("dogadjaji.txt", "rt") as file:
|
with open("dogadjaji.csv", "rt") as file:
|
||||||
file.readline()
|
file.readline()
|
||||||
for event in file.readlines():
|
for event in file.readlines():
|
||||||
event = event.strip()
|
event = event.strip()
|
||||||
@ -57,7 +57,7 @@ def load_events():
|
|||||||
return events
|
return events
|
||||||
|
|
||||||
def write_events(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")
|
file.write("datum, vreme, lokacija, tema\n")
|
||||||
for event in events:
|
for event in events:
|
||||||
file.write(event+"\n")
|
file.write(event+"\n")
|
||||||
@ -100,7 +100,7 @@ for event in future_events:
|
|||||||
|
|
||||||
events.append(end)
|
events.append(end)
|
||||||
|
|
||||||
with open("pages/dogadjaji.html","rt") as file:
|
with open("pages/events.html","rt") as file:
|
||||||
html = file.readlines()
|
html = file.readlines()
|
||||||
|
|
||||||
new_html = []
|
new_html = []
|
||||||
@ -126,5 +126,5 @@ while i<len(html):
|
|||||||
i+=1
|
i+=1
|
||||||
|
|
||||||
|
|
||||||
with open("pages/dogadjaji.html","wt") as file:
|
with open("pages/events.html","wt") as file:
|
||||||
file.writelines(new_html)
|
file.writelines(new_html)
|
||||||
|
Loading…
Reference in New Issue
Block a user