change arguments for starting feeder

+ add relative path for servicemanager
This commit is contained in:
2025-05-20 10:12:34 +02:00
parent cae4332bb8
commit fa5866ee33
2 changed files with 10 additions and 12 deletions

View File

@ -1,21 +1,21 @@
import sys
import sys, os
import socket
from streams import EventStream
from nicoscache import NicosStream
from secop import ScanStream, ScanReply, TrySecopConnect, send_fake_udp
from seinflux import SEHistory
from servicemanager import FrappyManager
from ..servicemanager import FrappyManager
USAGE = """
Usage:
start server
python feeder.py [<db instance>]
python feeder.py -d [<db instance>]
add a SECoP connection:
python feeder.py + uri [device] [instrument]
python feeder.py uri [device] [instrument]
"""
@ -57,12 +57,10 @@ def main(dbname=None):
db.disconnect()
if len(sys.argv) == 2:
main(sys.argv[1])
elif len(sys.argv) > 2:
if sys.argv[1] == '+':
send_fake_udp(*sys.argv[2:])
if len(sys.argv) >= 3:
if sys.argv[1] == '-d':
main(*sys.argv[2:])
else:
print(USAGE)
send_fake_udp(*sys.argv[1:])
else:
main()
print(USAGE)

View File

@ -291,7 +291,7 @@ class SEHistory(InfluxDBWrapper):
by_stream = {} # dict <stream> of [<ts>, <flag>, <instrument>, <device>]
for key, table in inperiod.items():
nextrow = nextrows.get(key)
if nextrow and not nextrow[1]:
if nextrow and not nextrow[0][1]:
table.extend(nextrow)
stream, instrument, device = [table.tags.get(k, '') for k in ('stream', 'instrument', 'device')]
elist = by_stream.setdefault(stream, [])