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) | ||||
|                 place = str(result.place) | ||||
|                 lineOne = f"{placeNative}" | ||||
|                 # lineTwo = f"[{place} in {result.competitionClass}]" | ||||
| 
 | ||||
|                 lines = [lineOne] | ||||
| 
 | ||||
|                 groupCompetition = result.competitionGroup | ||||
|                 if isinstance(groupCompetition, solo_turnier.group.CombinedGroup): | ||||
|                     lineTwo = f"[{place} in {groupCompetition}]" | ||||
|                     lines.append(lineTwo) | ||||
| 
 | ||||
|                 if not result.finalist: | ||||
|                     lines = ["kein/e Finalist/in"] + lines | ||||
| 
 | ||||
|                 return "\n".join(lines) | ||||
| 
 | ||||
|             mappedResults = map(mapResultColumn, results) | ||||
|              | ||||
| 
 | ||||
|             participantName = f'{participant.name} ({participant.id})' | ||||
|             if participant.club is not None: | ||||
|                 participantName = f'{participantName}, {participant.club}' | ||||
|  | ||||
| @ -51,6 +51,10 @@ | ||||
|                     {% endif %} | ||||
|                     <span class="{% if not res.finalist %}no-finalist-dance{% endif %}"> | ||||
|                       {{ res.getNativePlace() }} | ||||
|                       {% if res.isCombinedGroup() %} | ||||
|                       <br /> | ||||
|                       ({{ res.place }} {{ res.competitionGroup }}) | ||||
|                       {% endif %} | ||||
|                     </span> | ||||
|                     {% endif %} | ||||
|                 </td> | ||||
|  | ||||
| @ -7,6 +7,7 @@ class SingleParticipantResult: | ||||
|     def __init__( | ||||
|         self, | ||||
|         competitionClass: solo_turnier.competition_class.Class_t, | ||||
|         competitionGroup: solo_turnier.group.Group_t, | ||||
|         nativeClass: solo_turnier.competition_class.CompetitionClass, | ||||
|         dance: str, | ||||
|         finalist: bool, | ||||
| @ -14,6 +15,7 @@ class SingleParticipantResult: | ||||
|         nativePlace: Place = None, | ||||
|     ): | ||||
|         self.competitionClass = competitionClass | ||||
|         self.competitionGroup = competitionGroup | ||||
|         self.nativeClass = nativeClass | ||||
|         self.dance = dance | ||||
|         self.finalist = finalist | ||||
| @ -27,3 +29,6 @@ class SingleParticipantResult: | ||||
| 
 | ||||
|     def getNativePlace(self) -> str: | ||||
|         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) | ||||
| 
 | ||||
|         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) | ||||
|         self.l.log(5, "Id to participant mappting: %s", idToParticipantMapping) | ||||
|         self.l.log(5, "Id to participant mapping: %s", idToParticipantMapping) | ||||
| 
 | ||||
|         totalResult = {} | ||||
| 
 | ||||
| @ -96,6 +96,7 @@ class Worker: | ||||
|                     singleResult = solo_turnier.types.SingleParticipantResult( | ||||
|                         competitionClass=tup.class_, | ||||
|                         nativeClass=tup.class_, | ||||
|                         competitionGroup=tup.group, | ||||
|                         dance=tup.dance, | ||||
|                         finalist=singleHtmlResult.finalist, | ||||
|                         place=singleHtmlResult.place, | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user