change arguments for starting feeder
+ add relative path for servicemanager
This commit is contained in:
20
feeder.py
20
feeder.py
@ -1,21 +1,21 @@
|
|||||||
import sys
|
import sys, os
|
||||||
import socket
|
import socket
|
||||||
from streams import EventStream
|
from streams import EventStream
|
||||||
from nicoscache import NicosStream
|
from nicoscache import NicosStream
|
||||||
from secop import ScanStream, ScanReply, TrySecopConnect, send_fake_udp
|
from secop import ScanStream, ScanReply, TrySecopConnect, send_fake_udp
|
||||||
from seinflux import SEHistory
|
from seinflux import SEHistory
|
||||||
from servicemanager import FrappyManager
|
from ..servicemanager import FrappyManager
|
||||||
|
|
||||||
|
|
||||||
USAGE = """
|
USAGE = """
|
||||||
Usage:
|
Usage:
|
||||||
start server
|
start server
|
||||||
|
|
||||||
python feeder.py [<db instance>]
|
python feeder.py -d [<db instance>]
|
||||||
|
|
||||||
add a SECoP connection:
|
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()
|
db.disconnect()
|
||||||
|
|
||||||
|
|
||||||
if len(sys.argv) == 2:
|
if len(sys.argv) >= 3:
|
||||||
main(sys.argv[1])
|
if sys.argv[1] == '-d':
|
||||||
elif len(sys.argv) > 2:
|
main(*sys.argv[2:])
|
||||||
if sys.argv[1] == '+':
|
else:
|
||||||
send_fake_udp(*sys.argv[2:])
|
send_fake_udp(*sys.argv[1:])
|
||||||
else:
|
else:
|
||||||
print(USAGE)
|
print(USAGE)
|
||||||
else:
|
|
||||||
main()
|
|
||||||
|
@ -291,7 +291,7 @@ class SEHistory(InfluxDBWrapper):
|
|||||||
by_stream = {} # dict <stream> of [<ts>, <flag>, <instrument>, <device>]
|
by_stream = {} # dict <stream> of [<ts>, <flag>, <instrument>, <device>]
|
||||||
for key, table in inperiod.items():
|
for key, table in inperiod.items():
|
||||||
nextrow = nextrows.get(key)
|
nextrow = nextrows.get(key)
|
||||||
if nextrow and not nextrow[1]:
|
if nextrow and not nextrow[0][1]:
|
||||||
table.extend(nextrow)
|
table.extend(nextrow)
|
||||||
stream, instrument, device = [table.tags.get(k, '') for k in ('stream', 'instrument', 'device')]
|
stream, instrument, device = [table.tags.get(k, '') for k in ('stream', 'instrument', 'device')]
|
||||||
elist = by_stream.setdefault(stream, [])
|
elist = by_stream.setdefault(stream, [])
|
||||||
|
Reference in New Issue
Block a user