Changeset - 7a6739063595
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 20 months ago 2023-05-20 01:18:58
drewp@bigasterisk.com
shorten universe names
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/collector/weblisteners.py
Show inline comments
 
@@ -10,6 +10,10 @@ from light9.newtypes import (DeviceUri, 
 
log = logging.getLogger('weblisteners')
 

	
 

	
 
def shortenOutput(out: OutputUri) -> str:
 
    return str(out).rstrip('/').rsplit('/', 1)[-1]
 

	
 

	
 
class UiListener(Protocol):
 

	
 
    async def sendMessage(self, msg):
 
@@ -78,7 +82,7 @@ class WebListeners(object):
 
        for attr, val in attrs.items():
 
            outputUri, bufIndex = outputMap[(dev, attr)]
 
            dmxIndex = DmxIndex(bufIndex + 1)
 
            attrRows.append({'attr': attr.rsplit('/')[-1], 'val': val, 'chan': (outputUri, dmxIndex)})
 
            attrRows.append({'attr': attr.rsplit('/')[-1], 'val': val, 'chan': (shortenOutput(outputUri), dmxIndex)})
 
        attrRows.sort(key=lambda r: r['chan'])
 
        for row in attrRows:
 
            row['chan'] = '%s %s' % (row['chan'][0], row['chan'][1])
0 comments (0 inline, 0 general)