From 7bb2c9907d7f70872e1a6df56f81a5fc25663bb1 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Thu, 23 Apr 2026 16:03:02 +0200 Subject: [PATCH] add FrappyManager.run + make work on linse-a --- base.py | 4 +++- frappy.py | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/base.py b/base.py index 0ae9eb1..75785bd 100644 --- a/base.py +++ b/base.py @@ -100,6 +100,8 @@ class Config: configfile = Path('/sq_sw/linse/etc/linsetools.cfg') self.sections = read_config(configfile) instconfig = Path('/home/linse/.config/instrument.cfg') + if not instconfig.is_file(): + instconfig = Path('/home/l_samenv/.config/instrument.cfg') if instconfig.is_file(): self.instruments = read_config(instconfig) else: @@ -193,7 +195,7 @@ def wait_status(cl, service): class MarcheControl: port = 8124 otherarg = None - argmap = {k: 'action' for k in ('start', 'restart', 'stop', 'gui', 'cli', 'list', 'listcfg')} + argmap = {k: 'action' for k in ('start', 'restart', 'stop', 'gui', 'run', 'cli', 'list', 'listcfg')} def __init__(self, instrument=None, host='localhost', port=None, user=None, config=None): self.config = config or Config() diff --git a/frappy.py b/frappy.py index f8ec10d..b9e0dad 100644 --- a/frappy.py +++ b/frappy.py @@ -271,6 +271,9 @@ class FrappyControl(MarcheControl): if ambiguous: prt(f'{gap} ! {len(ambiguous)} ambiguous mappings sea -> frappy') + def run(self, cfg): + os.system(f'/sq_sw/linse/bin/frappy-server sinq {cfg}') + def do(self, action=None, service=None, cfg=None): if action == 'start': self.add_frappy_service(service, cfg, None) @@ -287,5 +290,7 @@ class FrappyControl(MarcheControl): self.gui() elif action in ('cli', None): self.cli() + elif action in ('run', None): + self.run(cfg) else: raise ArgError(f'unknown action {action!r}')