fixes
This commit is contained in:
parent
2d8ff40a13
commit
fd1551202c
1 changed files with 5 additions and 2 deletions
|
@ -13,7 +13,7 @@ event_period = "27.10. - 31.10.23"
|
||||||
event_org = "Verein der Freunde und Förderer der Bundesfachschaftentagung Elektrotechnik e.V."
|
event_org = "Verein der Freunde und Förderer der Bundesfachschaftentagung Elektrotechnik e.V."
|
||||||
event_name = "93. Bundesfachschaftentagung Elektrotechnik"
|
event_name = "93. Bundesfachschaftentagung Elektrotechnik"
|
||||||
attendees_csv = "/Users/dominik/Nextcloud BuFaTa ET/Ausschüsse/Generalsekreteriat/93_teilnehmer.csv"
|
attendees_csv = "/Users/dominik/Nextcloud BuFaTa ET/Ausschüsse/Generalsekreteriat/93_teilnehmer.csv"
|
||||||
empty_sheets = 2
|
empty_sheets = 1
|
||||||
template_form = "Teilnehmendenliste_FR_22_23_final.pdf"
|
template_form = "Teilnehmendenliste_FR_22_23_final.pdf"
|
||||||
date_list = ["27.10.23", "28.10.23", "29.10.23", "30.10.23", "31.10.23"]
|
date_list = ["27.10.23", "28.10.23", "29.10.23", "30.10.23", "31.10.23"]
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ def read_csv(csv_path):
|
||||||
with csvfile:
|
with csvfile:
|
||||||
reader = csv.DictReader(csvfile, delimiter=",")
|
reader = csv.DictReader(csvfile, delimiter=",")
|
||||||
persons = [{"Name": f"{t['Amtlicher Vorname'] if t['Amtlicher Vorname'] else t['Vorname']} {t['Nachname']}", "Hochschule": f"{t['Standort']}"} for t in reader if
|
persons = [{"Name": f"{t['Amtlicher Vorname'] if t['Amtlicher Vorname'] else t['Vorname']} {t['Nachname']}", "Hochschule": f"{t['Standort']}"} for t in reader if
|
||||||
t['Status'] == "Student"]
|
t['Status'] == "Immatrikuliert"]
|
||||||
persons.sort(key=itemgetter("Hochschule", "Name"))
|
persons.sort(key=itemgetter("Hochschule", "Name"))
|
||||||
for idx, p in enumerate(persons):
|
for idx, p in enumerate(persons):
|
||||||
p["Position"] = str(idx + 1)
|
p["Position"] = str(idx + 1)
|
||||||
|
@ -88,6 +88,9 @@ if __name__ == "__main__":
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
person_list = read_csv(csv_file_path)
|
person_list = read_csv(csv_file_path)
|
||||||
|
if not person_list:
|
||||||
|
print("CSV file was empty")
|
||||||
|
sys.exit(0)
|
||||||
persons_per_page = len(form_mapping)
|
persons_per_page = len(form_mapping)
|
||||||
|
|
||||||
person_list_per_page = [person_list[i:i + persons_per_page] for i in range(0, len(person_list), persons_per_page)]
|
person_list_per_page = [person_list[i:i + persons_per_page] for i in range(0, len(person_list), persons_per_page)]
|
||||||
|
|
Loading…
Reference in a new issue