def start(self, component): """ @type component: L{HTTPFileStreamer} """ if not isinstance(component, HTTPFileStreamer): raise ComponentStartError( "A CortadoPlug %s must be plugged into a " " HTTPStreamer component, not a %s" % (self, component.__class__.__name__)) filename = getCortadoFilename() if not filename: raise ComponentStartError("Could not find cortado jar file") log.debug('cortado', 'Attaching to %r' % (component, )) resource = CortadoDirectoryResource(component.getMountPoint(), self.args['properties'], filename) component.setRootResource(resource)
def start(self, component): """ @type component: L{HTTPFileStreamer} """ if not isinstance(component, HTTPFileStreamer): raise ComponentStartError( "A CortadoPlug %s must be plugged into a " " HTTPStreamer component, not a %s" % ( self, component.__class__.__name__)) filename = getCortadoFilename() if not filename: raise ComponentStartError( "Could not find cortado jar file") log.debug('cortado', 'Attaching to %r' % (component, )) resource = CortadoDirectoryResource(component.getMountPoint(), self.args['properties'], filename) component.setRootResource(resource)
def checkCortado(): """Check for cortado applet. @returns: a result containing the filename to the jar or None if it cannot be found @rtype: L{flumotion.common.messages.Result} """ log.debug('cortadocheck', 'Checking...') filename = getCortadoFilename() if not filename: msg = 'not found' else: msg = filename log.debug('cortadocheck', 'filename - %s' % (msg, )) result = Result() result.succeed(filename) log.debug('cortadocheck', 'done, returning') return result
def checkCortado(): """Check for cortado applet. @returns: a result containing the filename to the jar or None if it cannot be found @rtype: L{flumotion.common.messages.Result} """ log.debug('cortadocheck', 'Checking...') filename = getCortadoFilename() if not filename: msg = 'not found' else: msg = filename log.debug('cortadocheck', 'filename - %s' % (msg, )) result = Result() result.succeed(filename) log.debug('cortadocheck', 'done, returning') return result
def test(): import sys from twisted.internet import reactor from twisted.python.log import startLogging from twisted.web.server import Site startLogging(sys.stderr) properties = {'has-audio': True, 'has-video': True, 'codebase': '/', 'width': 320, 'height': 240, 'stream-url': '/stream.ogg', 'buffer-size': 40} root = CortadoDirectoryResource('/', properties, getCortadoFilename()) site = Site(root) reactor.listenTCP(8080, site) reactor.run()
def test(): import sys from twisted.internet import reactor from twisted.python.log import startLogging from twisted.web.server import Site startLogging(sys.stderr) properties = { 'has-audio': True, 'has-video': True, 'codebase': '/', 'width': 320, 'height': 240, 'stream-url': '/stream.ogg', 'buffer-size': 40 } root = CortadoDirectoryResource('/', properties, getCortadoFilename()) site = Site(root) reactor.listenTCP(8080, site) reactor.run()