followup change: fix dummy webserver
the dummy server was no longer working after server rework
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user