From 3f4051426e69e7e4383c309674a2d92cee240e7e Mon Sep 17 00:00:00 2001 From: Trygve Date: Wed, 8 Nov 2023 17:31:11 +0100 Subject: [PATCH] Fiksa strekktidsgenerering --- otime/iof_xml.py | 1 + otime/otime.py | 6 ++---- otime/pdf.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/otime/iof_xml.py b/otime/iof_xml.py index 5ff19f8..981d672 100644 --- a/otime/iof_xml.py +++ b/otime/iof_xml.py @@ -73,6 +73,7 @@ def create_result_file(event, file_path, o_classes=[]): for code, split in zip(i.course.codes, n.splits): st = ET.SubElement(result, 'SplitTime') xml_child(st, 'ControlCode', code) + if split != 0: xml_child(st, 'Time', split) else: xml_child(result, 'Status', n.status) else: diff --git a/otime/otime.py b/otime/otime.py index fd045f0..af99303 100644 --- a/otime/otime.py +++ b/otime/otime.py @@ -289,6 +289,7 @@ class Event: return False def get_runner_splits(self, id): + # Tida brukt frem til hver post, ikke tida fra forrige post try: runner = self.get_runner(id) card_dump = self.get_card_dump(runner.card_id) @@ -304,17 +305,14 @@ class Event: for n, control in enumerate(course.codes): if control not in card_dump.controls: continue - split_debt = 0 while True: try: punched_control, split = next(split_iter) except StopIteration: break if punched_control == control: - splits[n] = split + split_debt + splits[n] = split break - else: - split_debt += split return splits def get_runner_controls(self, id): diff --git a/otime/pdf.py b/otime/pdf.py index 227994e..de5d16a 100644 --- a/otime/pdf.py +++ b/otime/pdf.py @@ -44,7 +44,7 @@ def create_split_result_list(event, file_path, o_classes=[]): col_width = pdf.epw / 4 # distribute content evenly for class_result in results: - col_width = pdf.epw / (21+len(class_result.course.codes)) + col_width = 10 pdf.write(txt=class_result.name) pdf.ln(line_height) for runner in class_result.runner_results: