From 4048cfe94f77fac3b184e351707ce10240704e87 Mon Sep 17 00:00:00 2001 From: Trygve Date: Tue, 28 Nov 2023 01:33:53 +0100 Subject: [PATCH] la til forklaring i csven --- otime/file_io.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/otime/file_io.py b/otime/file_io.py index 9881576..92afd17 100644 --- a/otime/file_io.py +++ b/otime/file_io.py @@ -22,6 +22,7 @@ def write_card_dumps(event, file_path): def write_runners_csv(event, file_path): with open(file_path, 'w') as f: + f.write('ID;Status;Fornavn, Etternavn;Klasse;klubb;Brikke;Gafling;Starttid\n') for i in event.runners: f.write(f'{i.id};{i.status_override};{i.first}, {i.last};{i.o_class};{i.club};{i.card_id};{i.fork};{i.start_time}\n') @@ -37,6 +38,7 @@ def event_from_yaml_and_csv(config_path, mtr_path, csv_path): with open(csv_path, 'r') as f: data = [i.split(';') for i in f.readlines()] + data.pop(0) for i in data: i[2] = i[2].split(',') runners = [otime.Runner(id=i[0], status_override=i[1], first=i[2][0], last=i[2][1].strip(), o_class=i[3], club=i[4], card_id=int(i[5]), fork=int(i[6]), start_time=i[7]) for i in data] event.card_dumps = card_dumps