Commit 0ba04a5f authored by Tarik Graba's avatar Tarik Graba 😷
Browse files

Better when everything is written in one language

parent 17baff68
...@@ -38,16 +38,16 @@ cal = Calendar() ...@@ -38,16 +38,16 @@ cal = Calendar()
cal['summary'] = SUMMARY cal['summary'] = SUMMARY
with open(CSV_FNAME) as csvfile: with open(CSV_FNAME) as csvfile:
seances = csv.reader(csvfile, delimiter=';', quotechar='"') lines = csv.reader(csvfile, delimiter=';', quotechar='"')
# Skip the header # Skip the header
entete = next(seances) header = next(lines)
for seance in seances: for line in lines:
event = Event() event = Event()
description = seance[6] description = line[6]
date_debut = " ".join([seance[0], seance[2]]) date_start = " ".join([line[0], line[2]])
date_fin = " ".join([seance[0], seance[3]]) date_end = " ".join([line[0], line[3]])
ddate_d = date_locale.localize(datetime.strptime(date_debut, date_fmt)) ddate_d = date_locale.localize(datetime.strptime(date_start, date_fmt))
ddate_f = date_locale.localize(datetime.strptime(date_fin , date_fmt)) ddate_f = date_locale.localize(datetime.strptime(date_end , date_fmt))
event.add('summary', description) event.add('summary', description)
event.add('dtstart', ddate_d) event.add('dtstart', ddate_d)
event.add('dtend', ddate_f) event.add('dtend', ddate_f)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment