followup change: fix dummy webserver

the dummy server was no longer working after server rework
This commit is contained in:
l_samenv
2025-03-19 11:47:57 +01:00
committed by Markus Zolliker
parent 11a475149a
commit bc9c1361e5
3 changed files with 49 additions and 20 deletions

View File

@ -1,9 +1,32 @@
#!/usr/bin/env python3
import sys
import argparse
import pathlib
sys.path.insert(0, str((pathlib.Path(__file__) / '..').resolve()))
import webserver
from dummy import SecopDummyInstrument
from webserver import server
from base import Client
from dummy import DummyGraph, DummyHistory
from secop import SecopInteractor
webserver.instrument = webserver.main(SecopDummyInstrument)
def parseArgv(argv):
parser = argparse.ArgumentParser(
description="start webserver with dummy history and SECoP interaction",
)
parser.add_argument("port",
type=str,
default='8888',
nargs='?',
help="port number to serve")
parser.add_argument('-u',
'--uri',
action='store',
help='SECoP uri',
default='localhost:5000')
return parser.parse_args(argv)
args = parseArgv(sys.argv[1:])
server.run(int(args.port), DummyHistory(args.uri), DummyGraph, Client, single_instrument='dummy', secop=SecopInteractor)