From 0a324c3f0586fb82c0adb991a008835b8bb040f0 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Wed, 30 Apr 2025 16:13:52 +0200 Subject: [PATCH] treat single instance of seweb / sehistory properly there is only one seweb / sehistory instance. care has to be taken as the instrument is not part of the command --- base.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base.py b/base.py index 3bb027c..dd76ed6 100644 --- a/base.py +++ b/base.py @@ -84,6 +84,7 @@ class ServiceManager: revcmd = {} USAGE = None main_ins = None + single_ins = None def __init__(self): self.env = {} @@ -154,6 +155,8 @@ class ServiceManager: if cmd.startswith('PY '): cmd = env.get('PY', 'python3') + cmd[2:] self.commands[ins] = cmd + if len(self.info) == 1: + self.single_ins = list(self.info)[0] self.info = result #def get_cmdpats(self, groups): @@ -210,7 +213,7 @@ class ServiceManager: match = cmdpat.match(cmd) if match: gdict = match.groupdict() - ins = gdict.get('ins', self.main_ins) + ins = gdict.get('ins', self.main_ins) or self.single_ins serv = gdict.get('serv', '') if cfginfo is not None and 'cfg' in gdict: cfginfo[ins, serv] = gdict['cfg'] @@ -430,6 +433,7 @@ class ServiceManager: def do_list(self, ins=None, *args): """info about running services""" + self.get_info() show_unused = ins == 'all' if show_unused: ins = None