Extract groups for pure combined competitions
This commit is contained in:
parent
727ce0ca3a
commit
30e4a43a9f
@ -7,6 +7,9 @@ class Group:
|
||||
def __repr__(self):
|
||||
return self.name
|
||||
|
||||
def getContainedGroups(self):
|
||||
return (self,)
|
||||
|
||||
class CombinedGroup:
|
||||
def __init__(self, grpA: Group, grpB: Group):
|
||||
self.clsA = grpA
|
||||
@ -15,6 +18,9 @@ class CombinedGroup:
|
||||
def __repr__(self):
|
||||
return f'{self.clsA}/{self.clsB}'
|
||||
|
||||
def getContainedGroups(self):
|
||||
return (self.clsA, self.clsB)
|
||||
|
||||
Group_t = Group | CombinedGroup
|
||||
|
||||
class GroupParser:
|
||||
|
@ -494,7 +494,8 @@ class Worker:
|
||||
# groupSet.add(participant.group)
|
||||
for tup in data.htmlResults.results.keys():
|
||||
gr = groupParser.parseClass(tup[0])
|
||||
groupSet.add(gr)
|
||||
# groupSet.add(gr)
|
||||
groupSet.update(gr.getContainedGroups())
|
||||
# self.l.log(5, 'Group type %s', type(gr))
|
||||
|
||||
self.l.log(5, 'Set of active groups: %s', groupSet)
|
||||
@ -508,7 +509,8 @@ class Worker:
|
||||
additionalDances = set()
|
||||
foundDances = set()
|
||||
for tup in data.htmlResults.results.keys():
|
||||
if not groupParser.parseClass(tup[0]) == group:
|
||||
currentGroup = groupParser.parseClass(tup[0])
|
||||
if group not in currentGroup.getContainedGroups():
|
||||
continue
|
||||
foundDances.add(tup[2])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user