actually not showing components without representation
This commit is contained in:
parent
7d1bfbf73e
commit
119b85568f
12
wani.py
12
wani.py
|
@ -177,9 +177,6 @@ class ComponentRepresentation:
|
|||
def render(self):
|
||||
if self.rendition_text is None:
|
||||
self.rendition_text = self._render()
|
||||
|
||||
def rendition(self):
|
||||
return "" if self.rendition_text is None else self.rendition_text
|
||||
|
||||
def _render(self):
|
||||
raise NotImplementedError("Not implemented for class: {}".format(type(self)))
|
||||
|
@ -502,8 +499,13 @@ class ComponentRendition:
|
|||
rep.render()
|
||||
|
||||
for cid, reps in representations.items():
|
||||
rep = " ".join(rep.rendition() for rep in reps)
|
||||
matches.representations[cid] = rep
|
||||
reps = [rep.rendition_text for rep in reps]
|
||||
if len(reps) == 0:
|
||||
pass
|
||||
elif all(r is None for r in reps):
|
||||
matches.representations[cid] = None
|
||||
else:
|
||||
matches.representations[cid] = " ".join(("" if r is None else r) for r in reps)
|
||||
|
||||
# # just need to set representation to first group,
|
||||
# # but in correct order, agreements last!
|
||||
|
|
Loading…
Reference in New Issue
Block a user