From 3cec0ea3577068c3a001038f49d9b815b44ca0e7 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Mon, 13 May 2024 13:14:28 +0200 Subject: [PATCH] frappy.show_state: do not show partial status --- devices.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/devices.py b/devices.py index b87265c..89c24a9 100644 --- a/devices.py +++ b/devices.py @@ -352,7 +352,7 @@ class FrappyConfig(Device): self._back_to_normal = None # reset 'back to normal' machanism stickarg = stick - _, changes, fm = to_consider = self.to_consider() + need_change, changes, fm = to_consider = self.to_consider() confirmed = fm.sea.get_cfg(config.instrument, 'sea', True).split('/', 1)[0] if args: if main is not None: @@ -384,7 +384,7 @@ class FrappyConfig(Device): raise TypeError('got multiple values for addons') addons = ','.join(alist) elif main is None and stick is None and addons is None: # bare frappy() command - if update: + if update and need_change: self.update() else: self.show_state(False, to_consider) @@ -427,9 +427,10 @@ class FrappyConfig(Device): session.log.info(' %s', ' '.join(v.ljust(w) for w, v in zip(wid, row))) if self._rebuild_env: session.log.info(' %s', self._rebuild_env) - alternative = f" or {all_info(kwargs, '')}" if kwargs else '' - session.log.info(' ') - session.log.info(' use frappy()%s to configure sample environment', alternative) + if kwargs: + alternative = f" or {all_info(kwargs, '')}" if kwargs else '' + session.log.info(' ') + session.log.info(' use frappy()%s to configure sample environment', alternative) session.log.info(' %s', 75*'_') def update(self, main=None, stick=None, addons=None):