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:
E = CompetitionClass('E')
E = CompetitionClass("E")
def __init__(self):
self.mapNames = {
@ -59,7 +59,7 @@ class CompetitionClassParser:
# return CombinedCompetitionClass(clsA, clsB)
# else:
# return self.mapNames[cls]
if cls in self.mapNames:
return self.mapNames[cls]
else:

View File

@ -38,7 +38,10 @@ class HtmlParser:
match = re.compile('.*?OT, Solos (.*?)(?: ".*")?').fullmatch(title)
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}".')
rest = match.group(1)

View File

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

View File

@ -32,7 +32,11 @@ class ResultExtractor:
try:
data = parser.guessDataFromHtmlTitle()
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
except:
self.l.warning(