A Python UPnP Media Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.2 KiB

  1. # Licensed under the MIT license
  2. # http://opensource.org/licenses/mit-license.php
  3. # Copyright 2005, Tim Potter <tpot@samba.org>
  4. # Connection Manager service
  5. from twisted.python import log
  6. from twisted.web import resource, static, soap
  7. from upnp import UPnPPublisher
  8. class ConnectionManagerControl(UPnPPublisher):
  9. def soap_GetProtocolInfo(self, *args, **kwargs):
  10. log.msg('GetProtocolInfo(%s, %s)' % (repr(args), repr(kwargs)))
  11. return { 'Source': 'http-get:*:*:*', 'Sink': '' }
  12. def soap_PrepareForConnection(self, *args, **kwargs):
  13. log.msg('PrepareForConnection(%s, %s)' % (repr(args), repr(kwargs)))
  14. def soap_ConnectionComplete(self, *args, **kwargs):
  15. log.msg('ConnectionComplete(%s, %s)' % (repr(args), repr(kwargs)))
  16. def soap_GetCurrentConnectionIDs(self, *args, **kwargs):
  17. log.msg('GetCurrentConnectionIDs(%s, %s)' % (repr(args), repr(kwargs)))
  18. def soap_GetCurrentConnectionInfo(self, *args, **kwargs):
  19. log.msg('GetProtocolInfo(%s, %s)' % (repr(args), repr(kwargs)))
  20. class ConnectionManagerServer(resource.Resource):
  21. def __init__(self):
  22. resource.Resource.__init__(self)
  23. self.putChild(b'scpd.xml', static.File('connection-manager-scpd.xml'))
  24. self.putChild(b'control', ConnectionManagerControl())