move sehistory specific stuff from influx.py to seinflux.py
This commit is contained in:
12
streams.py
12
streams.py
@ -32,9 +32,12 @@ def short_hostname(host):
|
||||
- treat case where -129129xxxx is appended
|
||||
"""
|
||||
host = socket.gethostbyaddr(host)[0]
|
||||
match = re.match(r'([^.-]+)(?:-129129\d{6}|(-[~.]*|)).psi.ch', host)
|
||||
if match:
|
||||
host = match.group(1) + (match.group(2) or '')
|
||||
if host == 'localhost':
|
||||
host = socket.gethostname()
|
||||
else:
|
||||
match = re.match(r'([^.-]+)(?:-129129\d{6}|(-[~.]*|)).psi.ch', host)
|
||||
if match:
|
||||
host = match.group(1) + (match.group(2) or '')
|
||||
return host
|
||||
|
||||
|
||||
@ -246,8 +249,9 @@ class EventStream:
|
||||
# note: a stream with buffered content might not be ready to emit any event, because
|
||||
# of filtering
|
||||
|
||||
def __init__(self, *udp, **streams):
|
||||
def __init__(self, *udp, instrument=None, **streams):
|
||||
self.streams = streams
|
||||
self.instrument = instrument
|
||||
self.udp = {v.socket.fileno(): v for v in udp}
|
||||
|
||||
def wait_ready(self, timeout):
|
||||
|
Reference in New Issue
Block a user