software ramp mixin

+ fix frappy.lib.merge_status

Change-Id: I550eaeaab460a0d9ac1b027d59d4223dac4c0663
This commit is contained in:
2023-05-25 16:14:06 +02:00
parent e4dbb90065
commit bef190b77d
2 changed files with 99 additions and 65 deletions

View File

@@ -405,4 +405,8 @@ def merge_status(*args):
texts matching maximal code are joined with ', '
"""
maxcode = max(a[0] for a in args)
return maxcode, ', '.join([a[1] for a in args if a[0] == maxcode and a[1]])
# take status value matching highest status code
merged = [a[1] for a in args if a[0] == maxcode and a[1]]
# merge the split texts. use dict instead of set for keeping order
merged = {m: 0 for mm in merged for m in mm.split(', ')}
return maxcode, ', '.join(merged)