summaryrefslogtreecommitdiff
path: root/jfr_playoff/generator.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-07-06 01:15:34 +0200
committeremkael <emkael@tlen.pl>2018-07-06 01:23:22 +0200
commit8a29e0818606032bdecdf794e644dbb55d5f09b5 (patch)
tree8d51c7a5a231094f7da0e979ff113020452d889c /jfr_playoff/generator.py
parent00bb8ac06a45fd0cb960a7161a1f9cb713429a02 (diff)
Generating connector info between matches and starting positions
Diffstat (limited to 'jfr_playoff/generator.py')
-rw-r--r--jfr_playoff/generator.py27
1 files changed, 21 insertions, 6 deletions
diff --git a/jfr_playoff/generator.py b/jfr_playoff/generator.py
index a42130a..9b7f31e 100644
--- a/jfr_playoff/generator.py
+++ b/jfr_playoff/generator.py
@@ -106,16 +106,31 @@ class PlayoffGenerator(object):
def get_match_box(self, match, position):
if match is not None:
+ winner_link = [
+ str(m) for m in match.winner_matches
+ ] if match.winner_matches is not None else []
+ loser_link = [
+ str(m) for m in match.loser_matches
+ ] if match.loser_matches is not None else []
+ place_loser_link = []
+ place_winner_link = []
+ if 'starting_position_indicators' in self.page \
+ and self.page['starting_position_indicators']:
+ for team in match.teams:
+ if len(team.place) > 0:
+ place_link = ['place-' + str(pl) for pl in team.place]
+ if len(team.place) > 1:
+ place_loser_link += place_link
+ else:
+ place_winner_link += place_link
return self.p_temp.get(
'MATCH_BOX',
position[0], position[1],
match.id,
- ' '.join([
- str(m) for m in match.winner_matches
- ]) if match.winner_matches is not None else '',
- ' '.join([
- str(m) for m in match.loser_matches
- ]) if match.loser_matches is not None else '',
+ ' '.join(winner_link),
+ ' '.join(loser_link),
+ ' '.join(place_winner_link),
+ ' '.join(place_loser_link),
self.get_match_table(match))
return ''