This commit is contained in:
Dominik Rimpf 2023-10-28 22:32:48 +02:00
parent 2d8ff40a13
commit fd1551202c

View file

@ -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_name = "93. Bundesfachschaftentagung Elektrotechnik"
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"
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:
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
t['Status'] == "Student"]
t['Status'] == "Immatrikuliert"]
persons.sort(key=itemgetter("Hochschule", "Name"))
for idx, p in enumerate(persons):
p["Position"] = str(idx + 1)
@ -88,6 +88,9 @@ if __name__ == "__main__":
sys.exit(1)
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)
person_list_per_page = [person_list[i:i + persons_per_page] for i in range(0, len(person_list), persons_per_page)]