Fix code formatting issues

This commit is contained in:
Christian Wolf 2024-03-06 18:46:54 +01:00
parent d35d56cb81
commit d1b7c604b5
4 changed files with 12 additions and 7 deletions

View File

@ -42,7 +42,7 @@ class NoEClassException(Exception):
class CompetitionClassParser: class CompetitionClassParser:
E = CompetitionClass('E') E = CompetitionClass("E")
def __init__(self): def __init__(self):
self.mapNames = { self.mapNames = {

View File

@ -38,7 +38,10 @@ class HtmlParser:
match = re.compile('.*?OT, Solos (.*?)(?: ".*")?').fullmatch(title) match = re.compile('.*?OT, Solos (.*?)(?: ".*")?').fullmatch(title)
if match is None: if match is None:
self.l.info('Cannot parse html title "%s". Is it a solo competition? Possible bug.', title) self.l.info(
'Cannot parse html title "%s". Is it a solo competition? Possible bug.',
title,
)
raise Exception(f'Cannot parse title "{title}".') raise Exception(f'Cannot parse title "{title}".')
rest = match.group(1) rest = match.group(1)

View File

@ -26,9 +26,7 @@ class HtmlCompetitionTotalResults:
) -> list[HtmlSingleCompetitionResult]: ) -> list[HtmlSingleCompetitionResult]:
return self.results[self.__getTuple(group, class_, dance, id)] return self.results[self.__getTuple(group, class_, dance, id)]
def getById( def getById(self, id: int) -> dict[
self, id: int
) -> dict[
tuple[str, solo_turnier.group.Group_t, solo_turnier.competition_class.Class_t], tuple[str, solo_turnier.group.Group_t, solo_turnier.competition_class.Class_t],
HtmlSingleCompetitionResult, HtmlSingleCompetitionResult,
]: ]:

View File

@ -32,7 +32,11 @@ class ResultExtractor:
try: try:
data = parser.guessDataFromHtmlTitle() data = parser.guessDataFromHtmlTitle()
except competition_class.NoEClassException as ex: except competition_class.NoEClassException as ex:
self.l.info('The HTML file %s does not represent a solo E class. Skipping it. (%s)', filePair[0], ex) self.l.info(
"The HTML file %s does not represent a solo E class. Skipping it. (%s)",
filePair[0],
ex,
)
continue continue
except: except:
self.l.warning( self.l.warning(