fix circular import in frappy_sinq

This commit is contained in:
2022-05-02 10:11:16 +02:00
parent aaaca072e4
commit 41640c6c04
2 changed files with 22 additions and 23 deletions

View File

@@ -65,28 +65,6 @@ def all_info(all_cfg):
return 'currently configured: %s' % ', '.join(info)
def applyAliasConfig():
"""Apply the desired aliases from session.alias_config.
be more quiet than original
"""
# reimplemented from Session.applyAliasConfig
# apply also when target dev name does not change, as the target device might have
# be exchanged in the mean time
unused = set()
for aliasname, targets in session.alias_config.items():
if aliasname not in session.devices:
continue # silently ignore
aliasdev = session.getDevice(aliasname)
for target, _ in sorted(targets, key=lambda t: -t[1]):
if target in session.devices:
try:
aliasdev.alias = target
except Exception:
session.log.exception("could not set '%s' alias", aliasdev)
break
def frappy_start(service, cfg=None):
if service not in SERVICES:
raise ValueError('unknown service %s' % service)