summaryrefslogtreecommitdiff
path: root/jfr_playoff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-09-28 12:32:36 +0200
committeremkael <emkael@tlen.pl>2018-09-28 12:32:36 +0200
commit714a198c3cd4f0975c57010b3888d98057e6bb7c (patch)
treef3a9259983da61598d4597198ffa47457db9b16b /jfr_playoff
parent7a90aa51e77e201b51e8a9270c5e5da28cc3566f (diff)
Customize label character limit
Fixes #27
Diffstat (limited to 'jfr_playoff')
-rw-r--r--jfr_playoff/generator.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/jfr_playoff/generator.py b/jfr_playoff/generator.py
index 66e9a01..5dfed13 100644
--- a/jfr_playoff/generator.py
+++ b/jfr_playoff/generator.py
@@ -57,7 +57,10 @@ class PlayoffGenerator(object):
team_label = ' / '.join([
self.data.get_shortname(name) for name in
team.name.split('<br />')])
- team_label = team_label[:30] + (team_label[30:] and '(...)')
+ label_max_length = self.page['label_length_limit'] \
+ if 'label_length_limit' in self.page else 0
+ if label_max_length:
+ team_label = team_label[:label_max_length] + (team_label[label_max_length:] and '(...)')
team_html = self.p_temp.get(
'MATCH_TEAM_LINK',
match.link, team.name, team_label) \