summaryrefslogtreecommitdiff
path: root/jfr_playoff/data/match/jfrhtml.py
blob: 40f1395b66ea3e2dace3ef1fe5362b93b8c7224a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from jfr_playoff.data.match import MatchInfoClient
from jfr_playoff.logger import PlayoffLogger


class JFRHtmlMatchInfo(MatchInfoClient):
    @property
    def priority(self):
        return 30

    def is_capable(self):
        return ('link' in self.settings) and ('#' not in self.settings['link'])

    def get_exceptions(self, method):
        return (TypeError, IndexError, KeyError, IOError, ValueError)

    def get_match_link(self):
        PlayoffLogger.get('match.jfrhtml').info(
            'match #%d link pre-defined: %s',
            self.settings['id'], self.settings['link'])
        return self.settings['link']