Add optional output for combined groups
This commit is contained in:
parent
7ec359d2f2
commit
a7f8bad0ec
@ -117,16 +117,21 @@ class ConsoleOutputter(AbstractOutputter):
|
|||||||
placeNative = str(result.nativePlace)
|
placeNative = str(result.nativePlace)
|
||||||
place = str(result.place)
|
place = str(result.place)
|
||||||
lineOne = f"{placeNative}"
|
lineOne = f"{placeNative}"
|
||||||
# lineTwo = f"[{place} in {result.competitionClass}]"
|
|
||||||
|
|
||||||
lines = [lineOne]
|
lines = [lineOne]
|
||||||
|
|
||||||
|
groupCompetition = result.competitionGroup
|
||||||
|
if isinstance(groupCompetition, solo_turnier.group.CombinedGroup):
|
||||||
|
lineTwo = f"[{place} in {groupCompetition}]"
|
||||||
|
lines.append(lineTwo)
|
||||||
|
|
||||||
if not result.finalist:
|
if not result.finalist:
|
||||||
lines = ["kein/e Finalist/in"] + lines
|
lines = ["kein/e Finalist/in"] + lines
|
||||||
|
|
||||||
return "\n".join(lines)
|
return "\n".join(lines)
|
||||||
|
|
||||||
mappedResults = map(mapResultColumn, results)
|
mappedResults = map(mapResultColumn, results)
|
||||||
|
|
||||||
participantName = f'{participant.name} ({participant.id})'
|
participantName = f'{participant.name} ({participant.id})'
|
||||||
if participant.club is not None:
|
if participant.club is not None:
|
||||||
participantName = f'{participantName}, {participant.club}'
|
participantName = f'{participantName}, {participant.club}'
|
||||||
|
@ -51,6 +51,10 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<span class="{% if not res.finalist %}no-finalist-dance{% endif %}">
|
<span class="{% if not res.finalist %}no-finalist-dance{% endif %}">
|
||||||
{{ res.getNativePlace() }}
|
{{ res.getNativePlace() }}
|
||||||
|
{% if res.isCombinedGroup() %}
|
||||||
|
<br />
|
||||||
|
({{ res.place }} {{ res.competitionGroup }})
|
||||||
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
|
@ -7,6 +7,7 @@ class SingleParticipantResult:
|
|||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
competitionClass: solo_turnier.competition_class.Class_t,
|
competitionClass: solo_turnier.competition_class.Class_t,
|
||||||
|
competitionGroup: solo_turnier.group.Group_t,
|
||||||
nativeClass: solo_turnier.competition_class.CompetitionClass,
|
nativeClass: solo_turnier.competition_class.CompetitionClass,
|
||||||
dance: str,
|
dance: str,
|
||||||
finalist: bool,
|
finalist: bool,
|
||||||
@ -14,6 +15,7 @@ class SingleParticipantResult:
|
|||||||
nativePlace: Place = None,
|
nativePlace: Place = None,
|
||||||
):
|
):
|
||||||
self.competitionClass = competitionClass
|
self.competitionClass = competitionClass
|
||||||
|
self.competitionGroup = competitionGroup
|
||||||
self.nativeClass = nativeClass
|
self.nativeClass = nativeClass
|
||||||
self.dance = dance
|
self.dance = dance
|
||||||
self.finalist = finalist
|
self.finalist = finalist
|
||||||
@ -27,3 +29,6 @@ class SingleParticipantResult:
|
|||||||
|
|
||||||
def getNativePlace(self) -> str:
|
def getNativePlace(self) -> str:
|
||||||
return str(self.nativePlace)
|
return str(self.nativePlace)
|
||||||
|
|
||||||
|
def isCombinedGroup(self) -> bool:
|
||||||
|
return isinstance(self.competitionGroup, solo_turnier.group.CombinedGroup)
|
||||||
|
@ -42,10 +42,10 @@ class Worker:
|
|||||||
self.l.debug("Found groups in the dataset: %s", groups)
|
self.l.debug("Found groups in the dataset: %s", groups)
|
||||||
|
|
||||||
invertedGroupMapping = self._invertGroupMapping(groupMapping, groups)
|
invertedGroupMapping = self._invertGroupMapping(groupMapping, groups)
|
||||||
self.l.log(5, "Inverted group maping: %s", invertedGroupMapping)
|
self.l.log(5, "Inverted group mapping: %s", invertedGroupMapping)
|
||||||
|
|
||||||
idToParticipantMapping = self._invertIdMapping(importedData.htmlResults)
|
idToParticipantMapping = self._invertIdMapping(importedData.htmlResults)
|
||||||
self.l.log(5, "Id to participant mappting: %s", idToParticipantMapping)
|
self.l.log(5, "Id to participant mapping: %s", idToParticipantMapping)
|
||||||
|
|
||||||
totalResult = {}
|
totalResult = {}
|
||||||
|
|
||||||
@ -96,6 +96,7 @@ class Worker:
|
|||||||
singleResult = solo_turnier.types.SingleParticipantResult(
|
singleResult = solo_turnier.types.SingleParticipantResult(
|
||||||
competitionClass=tup.class_,
|
competitionClass=tup.class_,
|
||||||
nativeClass=tup.class_,
|
nativeClass=tup.class_,
|
||||||
|
competitionGroup=tup.group,
|
||||||
dance=tup.dance,
|
dance=tup.dance,
|
||||||
finalist=singleHtmlResult.finalist,
|
finalist=singleHtmlResult.finalist,
|
||||||
place=singleHtmlResult.place,
|
place=singleHtmlResult.place,
|
||||||
|
Loading…
Reference in New Issue
Block a user