summaryrefslogtreecommitdiff
path: root/src/daq
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2014-08-24 01:00:07 +0200
committerChristian Pointner <equinox@spreadspace.org>2014-08-24 01:00:07 +0200
commit3bdc78c9ed5325b3d08a4edb3d11b3bad6aee28c (patch)
tree17596a4fa5b801b8641756cdb63d9ec8895c5fad /src/daq
parentactually sending json data (diff)
added support for tags
Diffstat (limited to 'src/daq')
-rw-r--r--src/daq/flumotion-plug/sfive.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/daq/flumotion-plug/sfive.py b/src/daq/flumotion-plug/sfive.py
index 59918ca..231081b 100644
--- a/src/daq/flumotion-plug/sfive.py
+++ b/src/daq/flumotion-plug/sfive.py
@@ -45,6 +45,7 @@ from flumotion.common.i18n import N_
T_ = i18n.gettexter()
_DEFAULT_POLL_INTERVAL = 5 # in seconds
+_RECONNECT_TIMEOUT = 2 # in seconds
__version__ = "$Rev$"
@@ -91,6 +92,8 @@ class ComponentSFivePlug(base.ComponentPlug):
self._content_id = properties.get('content-id')
self._format = properties.get('format')
self._quality = properties.get('quality')
+ tagstring = properties.get('tags', '')
+ self._tags = [x.strip() for x in tagstring.split(',')]
self._duration = properties.get('duration', _DEFAULT_POLL_INTERVAL)
self._sfivepoller = Poller(self._updateSFive, self._duration, start=False)
@@ -118,7 +121,7 @@ class ComponentSFivePlug(base.ComponentPlug):
if self._conn:
self._conn.stopListening()
- reactor.callLater(5, self._initSocket)
+ reactor.callLater(_RECONNECT_TIMEOUT, self._initSocket)
def _socketReady(self):
self.info('SFive: connection to sfive hub established')
@@ -132,7 +135,7 @@ class ComponentSFivePlug(base.ComponentPlug):
self.debug('SFive: sending init message')
initdata = { "hostname": self._hostname,
"streamer-id": { "content-id": self._content_id, "format": self._format, "quality": self._quality },
- "tags": [] }
+ "tags": self._tags }
self._proto.sendDatagram(json.dumps(initdata));
def _updateSFive(self):