Fiksa strekktidsgenerering
This commit is contained in:
parent
bf0b400708
commit
3f4051426e
@ -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:
|
||||
|
@ -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):
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user