interactive client: improve watch function

- watch is now a command, not a module method
- finish watching with ctrl-C
- watching an io module logs communication
- add bin/frappy-cli to start interactive client
+ remove sorted function from StructOf.format_value

Change-Id: I7dd707473e4534f2d39c5d6afc533c2d872380f8
This commit is contained in:
zolliker 2023-01-30 14:28:13 +01:00
parent f7e24f13bb
commit 240c4f027b
2 changed files with 2 additions and 2 deletions

View File

@ -1035,7 +1035,7 @@ class StructOf(DataType):
return self(dict(value))
def format_value(self, value, unit=None):
return '{%s}' % (', '.join(['%s=%s' % (k, self.members[k].format_value(v)) for k, v in sorted(value.items())]))
return '{%s}' % (', '.join(['%s=%s' % (k, self.members[k].format_value(v)) for k, v in value.items()]))
def compatible(self, other):
try:

View File

@ -474,7 +474,7 @@ def test_StructOf():
assert dt.import_value({'an_int': 13, 'a_string': 'WFEC'}) == {
'a_string': 'WFEC', 'an_int': 13}
assert dt.format_value({'an_int':2, 'a_string':'Z'}) == "{a_string='Z', an_int=2}"
assert dt.format_value({'an_int': 2, 'a_string': 'Z'}) == "{an_int=2, a_string='Z'}"
dt = StructOf(['optionalmember'], optionalmember=EnumType('myenum', single=0))
copytest(dt)