forked from Trygve/otime
commit
This commit is contained in:
parent
4416ece0a9
commit
1a3dc6f4e2
17
otime.py
17
otime.py
@ -148,7 +148,11 @@ class runner:
|
||||
# Returns False if not ok and touple if ok
|
||||
return contains(self.o_class.course.codes, self.controls)
|
||||
def totaltime(self):
|
||||
return self.splits[-2]
|
||||
f_control = self.o_class.course.codes[-1]
|
||||
try:
|
||||
return self.card_r.punches[f_control]
|
||||
except:
|
||||
return list(self.card_r.punches.values())[-1]
|
||||
|
||||
def status(self):
|
||||
if self.controls == []:
|
||||
@ -161,11 +165,12 @@ class runner:
|
||||
c_ranked = rank_runners(allrunners, self.o_class)
|
||||
return c_ranked.index(self) + 1
|
||||
def res_splits(self):
|
||||
control_map = self.check_codes()
|
||||
splits = []
|
||||
for n in control_map:
|
||||
splits.append(self.splits[n])
|
||||
return splits
|
||||
res_p = self.card_r.punches.copy()
|
||||
for key in res_p.keys:
|
||||
if key not in self.o_class.course.codes
|
||||
res_p.pop(key)
|
||||
return res_p
|
||||
|
||||
class card_punch:
|
||||
def __init__(self, card, punches, s_time, f_time):
|
||||
self.card = card
|
||||
|
Loading…
Reference in New Issue
Block a user