[WIP] add <disconnected> info

This commit is contained in:
2023-10-17 13:54:36 +02:00
parent aa40e0255b
commit b97eff8afb

View File

@ -178,7 +178,8 @@ class FrappyConfig(Device):
for service, guess in list(proposed.items()):
if guess is True:
proposed.pop(service)
return proposed, state, remarks
disconnected = {k for k, v in cfgs.items() if v == '<disconnected>'}
return proposed, state + (disconnected,), remarks
def check_services(self):
cfgs = {}
@ -313,9 +314,11 @@ class FrappyConfig(Device):
if show_server_state == 'auto':
show_server_state = state != self._previous_shown
if show_server_state:
frappycfgs, seacfgs = state
frappycfgs, seacfgs, disconnected = state
rows = [['server', 'frappy', 'sea', '']]
for key, remark in remarks.items():
if key in disconnected:
remark = 'disconnected'
rows.append([key if key in ('main', 'stick') else 'addons',
frappycfgs.get(key, ''), seacfgs.get(key, ''), remark])
wid = [max(len(v) for v in column) for column in zip(*rows)]
@ -333,7 +336,7 @@ class FrappyConfig(Device):
if proposed:
info = all_info(proposed, 'proposed configuration: ')
session.log.warning(info)
session.log.info(info)
session.log.warning('please consider to call: frappy.update() for above configuration')
if '?' in info:
session.log.warning("but create cfg files first for items marked with '?'")
@ -643,6 +646,8 @@ class FrappyNode(SecNodeDevice, Moveable):
def get_info(self):
result = self.doRead() or ''
code, text = self.status()
if not result and self.target:
return '<disconnected>'
if code == status.OK or result == '':
return result
if (code, text) == (status.ERROR, 'reconnecting'):