Stopper strekktider når målpost er nådd

This commit is contained in:
Trygve 2022-03-27 16:51:01 +02:00
parent af8bd3a31c
commit c15fd70cf2

View File

@ -102,10 +102,13 @@ class event:
xml_child(result, 'Position', n.rank(self.runners))
xml_child(result, 'Status', n.status())
#<SplitTime>
#TODO: ta utgangspunkt i løypa, ikke det brikka har stempla
for code,split in zip(n.card_r.controls,n.card_r.splits):
st = ET.SubElement(result, 'SplitTime')
xml_child(st, 'ControlCode', code)
xml_child(st, 'Time', split)
if code == n.o_class.course.codes[-1]:
break
#</SplitTime>
elif n.status() == 'Disqualified':
xml_child(result, 'Status', n.status())
@ -284,7 +287,7 @@ def courses_from_ttime_conf(ttime_file = 'sc_2021_ttime/ttime.cnf.txt'):
return courses
def classes_from_ttime_conf(ttime_file, courses):
o_classes = []
conf = open(ttime_file, 'r', encoding='latin_1').readlines()
conf = open(ttime_file, 'r').readlines()
for line in conf:
if '-courses' in line:
raw_courselist = re.search(r'(?<=\")(.*?)(?=\")', line).group().split(';')