From 3bdc78c9ed5325b3d08a4edb3d11b3bad6aee28c Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 24 Aug 2014 01:00:07 +0200 Subject: added support for tags --- src/daq/flumotion-plug/sfive.py | 7 +++++-- 1 file 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): -- cgit v1.2.3