From 06bfe301e9b69b8e3264e8ec344a7ca0ff9e6a81 Mon Sep 17 00:00:00 2001 From: emkael Date: Sun, 29 Dec 2019 15:45:03 +0100 Subject: Code formatting --- jfr_playoff/tournamentinfo.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'jfr_playoff') diff --git a/jfr_playoff/tournamentinfo.py b/jfr_playoff/tournamentinfo.py index e992bc9..70e341f 100644 --- a/jfr_playoff/tournamentinfo.py +++ b/jfr_playoff/tournamentinfo.py @@ -22,10 +22,16 @@ class TournamentInfo: if not self.settings['link'].endswith('leaderb.html'): raise ValueError('invalid link to tournament results') PlayoffLogger.get('tournamentinfo').info( - 'fetching tournament results from leaderboard URL: %s', self.settings['link']) + 'fetching tournament results from leaderboard URL: %s', + self.settings['link']) leaderboard = p_remote.fetch(self.settings['link']) - result_links = [row.select('a[onmouseover]') for row in leaderboard.find_all('tr') if len(row.select('a[onmouseover]')) > 0] - results = [None] * (len(result_links) * max([len(links) for links in result_links])) + result_links = [ + row.select('a[onmouseover]') + for row + in leaderboard.find_all('tr') + if len(row.select('a[onmouseover]')) > 0] + results = [None] * (len(result_links) * max([ + len(links) for links in result_links])) for i in range(0, len(result_links)): for j in range(0, len(result_links[i])): results[len(result_links) * j + i] = result_links[i][j] @@ -105,8 +111,13 @@ class TournamentInfo: contains_digits = any(char.isdigit() for char in leaderb_heading) PlayoffLogger.get('tournamentinfo').info( 'tournament header from HTML: %s, %s', - leaderb_heading, 'contains digits' if contains_digits else "doesn't contain digits") - non_zero_scores = [imps.text for imps in leaderboard.select('td.bdc small') if imps.text != '0-0'] + leaderb_heading, + 'contains digits' if contains_digits else "doesn't contain digits") + non_zero_scores = [ + imps.text + for imps + in leaderboard.select('td.bdc small') + if imps.text != '0-0'] PlayoffLogger.get('tournamentinfo').info( 'tournament leaderboard from HTML: has %d non-zero scores', len(non_zero_scores)) -- cgit v1.2.3