flumotion/master: Move getUrl to the base class
flumotion subversion commit list
flumotion-commit at lists.fluendo.com
Tue Sep 27 13:31:53 CEST 2011
Module: flumotion
Branch: master
Commit: 04d288f1f0bae13c6439a3ae6f467b8e74a0b8ee
URL: http://code.flumotion.com/cgit//flumotion/commit/?id=04d288f1f0bae13c6439a3ae6f467b8e74a0b8ee
Author: Andoni Morales Alastruey <ylatuya at gmail.com>
Date: Tue Sep 13 11:52:10 2011 +0200
Move getUrl to the base class
---
.../common/streamer/multifdsinkstreamer.py | 15 ---------------
flumotion/component/common/streamer/streamer.py | 14 +++++++++++++-
2 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/flumotion/component/common/streamer/multifdsinkstreamer.py b/flumotion/component/common/streamer/multifdsinkstreamer.py
index 486662a..539ffba 100644
--- a/flumotion/component/common/streamer/multifdsinkstreamer.py
+++ b/flumotion/component/common/streamer/multifdsinkstreamer.py
@@ -198,21 +198,6 @@ class MultifdSinkStreamer(streamer.Streamer, Stats):
mime += ";boundary=ThisRandomString"
return mime
- def getUrl(self):
- port = self.port
-
- if self.type == 'slave' and self._pbclient:
- if not self._pbclient.remote_port:
- return ""
- port = self._pbclient.remote_port
-
- if (not port) or (port == 80):
- port_str = ""
- else:
- port_str = ":%d" % port
-
- return "http://%s%s%s" % (self.hostname, port_str, self.mountPoint)
-
def add_client(self, fd, request):
sink = self.get_element('sink')
sink.emit('add', fd)
diff --git a/flumotion/component/common/streamer/streamer.py b/flumotion/component/common/streamer/streamer.py
index 1e1f234..9e90051 100644
--- a/flumotion/component/common/streamer/streamer.py
+++ b/flumotion/component/common/streamer/streamer.py
@@ -436,7 +436,19 @@ class Streamer(feedcomponent.ParseLaunchComponent, Stats):
"subclasses")
def getUrl(self):
- raise NotImplemented("getUrl must be implemented by subclasses")
+ port = self.port
+
+ if self.type == 'slave' and self._pbclient:
+ if not self._pbclient.remote_port:
+ return ""
+ port = self._pbclient.remote_port
+
+ if (not port) or (port == 80):
+ port_str = ""
+ else:
+ port_str = ":%d" % port
+
+ return "http://%s%s%s" % (self.hostname, port_str, self.mountPoint)
def getStreamData(self):
socket = 'flumotion.component.plugs.streamdata.StreamDataProviderPlug'
More information about the flumotion-commit
mailing list