From e1f1f59ecbdf749a215e631438efaf7ddc20c247 Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 6 Jul 2018 01:09:50 +0200 Subject: Storing information about seeding from starting positions in match info object --- jfr_playoff/dto.py | 4 ++++ jfr_playoff/matchinfo.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/jfr_playoff/dto.py b/jfr_playoff/dto.py index a88cd2b..fa22265 100644 --- a/jfr_playoff/dto.py +++ b/jfr_playoff/dto.py @@ -10,6 +10,10 @@ def coalesce(*arg): class Team(object): name = '' score = 0.0 + place = None + + def __init__(self): + self.place = [] def __unicode__(self): return u'%s (%.1f)' % (coalesce(self.name, ''), self.score) diff --git a/jfr_playoff/matchinfo.py b/jfr_playoff/matchinfo.py index 93b997a..5a31577 100644 --- a/jfr_playoff/matchinfo.py +++ b/jfr_playoff/matchinfo.py @@ -187,6 +187,10 @@ class MatchInfo: 'fetching HTML scores for match #%d failed: %s(%s)', self.info.id, type(e).__name__, str(e)) self.info.teams = self.__get_config_teams(self.info.teams) + for team in range(0, len(self.info.teams)): + if 'place' in self.config['teams'][team]: + self.info.teams[team].place = self.config['teams'][team]['place'] + def __get_db_board_count(self): towels = self.database.fetch( -- cgit v1.2.3