main ins no longer needed in command
- MAIN is automatically replaced by the basename of the home directory - when %(ins) is omitted in *_command, it is also replaced by this + add help subcommand
This commit is contained in:
5
base.py
5
base.py
@ -83,6 +83,7 @@ class ServiceManager:
|
||||
pkg = ''
|
||||
revcmd = {}
|
||||
USAGE = None
|
||||
main_instrument = basename(expanduser('~'))
|
||||
|
||||
def __init__(self):
|
||||
self.env = {}
|
||||
@ -136,7 +137,7 @@ class ServiceManager:
|
||||
for ins in parser.sections():
|
||||
section = dict(parser[ins])
|
||||
if ins == 'MAIN':
|
||||
ins = basename(expanduser('~'))
|
||||
ins = self.main_instrument
|
||||
command = section.get('%s_command' % self.group)
|
||||
self.revcmd[command] = self.group
|
||||
nr = section.get(self.group)
|
||||
@ -192,7 +193,7 @@ class ServiceManager:
|
||||
match = cmdpat.match(cmd)
|
||||
if match:
|
||||
gdict = match.groupdict()
|
||||
ins = gdict['ins']
|
||||
ins = gdict.get('ins', self.main_instrument)
|
||||
serv = gdict.get('serv', '')
|
||||
if cfginfo is not None and 'cfg' in gdict:
|
||||
cfginfo[ins, serv] = gdict['cfg']
|
||||
|
Reference in New Issue
Block a user