From 714a198c3cd4f0975c57010b3888d98057e6bb7c Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 28 Sep 2018 12:32:36 +0200 Subject: Customize label character limit Fixes #27 --- jfr_playoff/generator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'jfr_playoff/generator.py') 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('
')]) - 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) \ -- cgit v1.2.3