diff options
author | emkael <emkael@tlen.pl> | 2018-09-28 17:37:16 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2018-09-28 17:37:16 +0200 |
commit | 72e52cf8c572f262d022acaa1eb1aa65bccb099e (patch) | |
tree | ae22e9f6cd22bd673da56c8111912e0b37f4209d /jfr_playoff/generator.py | |
parent | f5ac370c094ae393dc0348bbbf31bef1fe9a7208 (diff) |
Refactoring of some config dictionary default value fetches
Diffstat (limited to 'jfr_playoff/generator.py')
-rw-r--r-- | jfr_playoff/generator.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/jfr_playoff/generator.py b/jfr_playoff/generator.py index 5dfed13..d358d86 100644 --- a/jfr_playoff/generator.py +++ b/jfr_playoff/generator.py @@ -57,8 +57,7 @@ class PlayoffGenerator(object): team_label = ' / '.join([ self.data.get_shortname(name) for name in team.name.split('<br />')]) - label_max_length = self.page['label_length_limit'] \ - if 'label_length_limit' in self.page else 0 + label_max_length = self.page.get('label_length_limit', 0) if label_max_length: team_label = team_label[:label_max_length] + (team_label[label_max_length:] and '(...)') team_html = self.p_temp.get( @@ -199,7 +198,7 @@ class PlayoffGenerator(object): info = [] for event in self.data.get_swiss_info(): event_label = self.p_temp.get('SWISS_DEFAULT_LABEL', event['position']) - if 'label' in event and event['label'] is not None: + if event.get('label', None): event_label = event['label'] info.append((self.p_temp.get('SWISS_LINK', event['link'], event_label) \ |