Ta starttid fra ttime db

This commit is contained in:
Trygve 2022-03-29 23:08:29 +02:00
parent 09723e6966
commit 2b22bcb7e1

View File

@ -128,7 +128,7 @@ class event:
ET.indent(root, space=' ', level=0)
return tree
class runner:
def __init__(self, runner_id, first, last, club, country, card, o_class):
def __init__(self, runner_id, first, last, club, country, card, o_class, start_time):
self.id = runner_id
self.first = first
self.last = last
@ -136,7 +136,9 @@ class runner:
self.country = country
self.card = card
self.o_class = o_class
self.start_time = start_time
def from_string(tt_line, o_classes):
#https://web.archive.org/web/20191229124046/http://wiki.ttime.no/index.php/Developer
eventorid = tt_line[0]
country = ''
name = tt_line[2].split(',')
@ -168,7 +170,12 @@ class runner:
else:
runner_o_class = None
# TODO: Gjør sånn at den lager nye o klasser om den ikke finnes fra før
return runner(eventorid, first, last, club, country, card, runner_o_class)
try:
options = tt_line[5].split(',')
start_time = options[options.index('U')+1]
except:
start_time = None
return runner(eventorid, first, last, club, country, card, runner_o_class, start_time)
def fullname(self):
return '{} {}'.format(self.first, self.last)