summaryrefslogtreecommitdiff
path: root/jfr_playoff/generator.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-10-03 16:20:22 +0200
committeremkael <emkael@tlen.pl>2017-10-03 16:20:22 +0200
commit37df04c91788d023681c8a7015b9807764974a1d (patch)
tree0b5c108681b5ea222e2c6d0f7358b372c893f885 /jfr_playoff/generator.py
parent31f3d7ed154c24ffd9c84448effb1d87b7456ade (diff)
Ability to classify teams from specified position according to sepatare tournament results
Diffstat (limited to 'jfr_playoff/generator.py')
-rw-r--r--jfr_playoff/generator.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/jfr_playoff/generator.py b/jfr_playoff/generator.py
index 5868750..479f33b 100644
--- a/jfr_playoff/generator.py
+++ b/jfr_playoff/generator.py
@@ -25,7 +25,8 @@ class PlayoffGenerator(object):
self.data.get_dimensions(),
self.data.generate_phases(),
self.data.fill_match_info()),
- self.get_leaderboard_table(self.data.fill_leaderboard()),
+ self.get_swiss_links(),
+ self.get_leaderboard_table(),
p_temp.PAGE_BODY_FOOTER.decode('utf8') % (
datetime.now().strftime('%Y-%m-%d o %H:%M'))))
@@ -109,7 +110,8 @@ class PlayoffGenerator(object):
grid_boxes
)
- def get_leaderboard_table(self, leaderboard):
+ def get_leaderboard_table(self):
+ leaderboard = self.data.fill_leaderboard()
if len([t for t in leaderboard if t is not None]) == 0:
return ''
position = 1
@@ -121,6 +123,12 @@ class PlayoffGenerator(object):
html = p_temp.LEADERBOARD.decode('utf8') % (rows)
return html
+ def get_swiss_links(self):
+ return '\n'.join([
+ p_temp.SWISS_LINK % (
+ event['link'], event['position']
+ ) for event in self.data.get_swiss_info()])
+
def get_flag(self, team):
flag = self.data.get_team_image(team)
return '' if flag is None else p_temp.LEADERBOARD_ROW_FLAG % (flag)