|
|
|
@ -101,11 +101,10 @@ class LiveGroupStage: |
|
|
|
self.teams.append(team) |
|
|
|
self.teams.append(team) |
|
|
|
|
|
|
|
|
|
|
|
def formatted_duration(self): |
|
|
|
def formatted_duration(self): |
|
|
|
# return "test d" |
|
|
|
|
|
|
|
if self.start and self.end: |
|
|
|
if self.start and self.end: |
|
|
|
return format_seconds((self.end - self.start).total_seconds()) |
|
|
|
return format_seconds((self.end - self.start).total_seconds()) |
|
|
|
else: |
|
|
|
else: |
|
|
|
return "--" |
|
|
|
return "" |
|
|
|
|
|
|
|
|
|
|
|
def to_dict(self): |
|
|
|
def to_dict(self): |
|
|
|
return { |
|
|
|
return { |
|
|
|
@ -114,18 +113,6 @@ class LiveGroupStage: |
|
|
|
"duration": self.formatted_duration() |
|
|
|
"duration": self.formatted_duration() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
def lean(self): |
|
|
|
|
|
|
|
leanteams = [] |
|
|
|
|
|
|
|
for team in self.teams: |
|
|
|
|
|
|
|
leanteams.append(team.lean()) |
|
|
|
|
|
|
|
return LeanGroupStage(self.title, [], self.formatted_duration()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class LeanGroupStage: |
|
|
|
|
|
|
|
def __init__(self, title, teams, duration): |
|
|
|
|
|
|
|
self.title = title |
|
|
|
|
|
|
|
self.teams = teams |
|
|
|
|
|
|
|
self.duration = duration |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class GroupStageTeam: |
|
|
|
class GroupStageTeam: |
|
|
|
def __init__(self, team_registration): |
|
|
|
def __init__(self, team_registration): |
|
|
|
self.names = team_registration.team_names() |
|
|
|
self.names = team_registration.team_names() |
|
|
|
@ -149,12 +136,3 @@ class GroupStageTeam: |
|
|
|
"win_loss": self.wins_losses(), |
|
|
|
"win_loss": self.wins_losses(), |
|
|
|
"diff": self.formatted_diff() |
|
|
|
"diff": self.formatted_diff() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
def lean(self): |
|
|
|
|
|
|
|
return LeanTeam(self.names, self.wins_losses(), self.formatted_diff()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class LeanTeam: |
|
|
|
|
|
|
|
def __init__(self, names, winloss, diff): |
|
|
|
|
|
|
|
self.names = names |
|
|
|
|
|
|
|
self.winloss = winloss |
|
|
|
|
|
|
|
self.diff = diff |
|
|
|
|
|
|
|
|