From 240c4f027bf1c5d195e1c4fb8e28d7c9c0a3e47d Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Mon, 30 Jan 2023 14:28:13 +0100 Subject: [PATCH] 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 --- frappy/datatypes.py | 2 +- test/test_datatypes.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frappy/datatypes.py b/frappy/datatypes.py index 4da0b87..4266939 100644 --- a/frappy/datatypes.py +++ b/frappy/datatypes.py @@ -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: diff --git a/test/test_datatypes.py b/test/test_datatypes.py index 2cf98bc..96cfa95 100644 --- a/test/test_datatypes.py +++ b/test/test_datatypes.py @@ -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)