summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-09-28 14:30:19 +0200
committeremkael <emkael@tlen.pl>2018-09-28 14:30:19 +0200
commit528bbb28fafdef9aa107149fa5f2a90dccfa00f9 (patch)
tree974d660ee6ab6b2d95d4a71898d522fd19ba16d1
parent714a198c3cd4f0975c57010b3888d98057e6bb7c (diff)
Comments on the code for single-segment match team/score fetching
-rw-r--r--jfr_playoff/matchinfo.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/jfr_playoff/matchinfo.py b/jfr_playoff/matchinfo.py
index 2aeb2c1..b40d6d1 100644
--- a/jfr_playoff/matchinfo.py
+++ b/jfr_playoff/matchinfo.py
@@ -116,6 +116,7 @@ class MatchInfo:
in row.select('td.bdc')[-1].contents
if isinstance(text, unicode)]
except ValueError:
+ # single-segment match
try:
# running single-segment
scores = [
@@ -272,11 +273,14 @@ class MatchInfo:
segments = [cell for cell in cells if self.__has_segment_link(cell)]
towels = [cell for cell in cells if self.__has_towel_image(cell)]
if len(segments) == 0:
+ # in single-segment match, there are no td.bdc cells with segment links
+ # but maybe it's a multi-segment match with towels
if len(towels) > 0:
PlayoffLogger.get('matchinfo').info(
'HTML board count for match #%d: all towels', self.info.id)
return 1, 1 # entire match is toweled, so mark as finished
else:
+ # not a single-segment match, no need to look for td.bdcg cells
break
if len(segments) == 0:
raise ValueError('segments not found')