Ta starttid fra ttime db
This commit is contained in:
parent
09723e6966
commit
2b22bcb7e1
11
otime.py
11
otime.py
@ -128,7 +128,7 @@ class event:
|
|||||||
ET.indent(root, space=' ', level=0)
|
ET.indent(root, space=' ', level=0)
|
||||||
return tree
|
return tree
|
||||||
class runner:
|
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.id = runner_id
|
||||||
self.first = first
|
self.first = first
|
||||||
self.last = last
|
self.last = last
|
||||||
@ -136,7 +136,9 @@ class runner:
|
|||||||
self.country = country
|
self.country = country
|
||||||
self.card = card
|
self.card = card
|
||||||
self.o_class = o_class
|
self.o_class = o_class
|
||||||
|
self.start_time = start_time
|
||||||
def from_string(tt_line, o_classes):
|
def from_string(tt_line, o_classes):
|
||||||
|
#https://web.archive.org/web/20191229124046/http://wiki.ttime.no/index.php/Developer
|
||||||
eventorid = tt_line[0]
|
eventorid = tt_line[0]
|
||||||
country = ''
|
country = ''
|
||||||
name = tt_line[2].split(',')
|
name = tt_line[2].split(',')
|
||||||
@ -168,7 +170,12 @@ class runner:
|
|||||||
else:
|
else:
|
||||||
runner_o_class = None
|
runner_o_class = None
|
||||||
# TODO: Gjør sånn at den lager nye o klasser om den ikke finnes fra før
|
# 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):
|
def fullname(self):
|
||||||
return '{} {}'.format(self.first, self.last)
|
return '{} {}'.format(self.first, self.last)
|
||||||
|
Loading…
Reference in New Issue
Block a user