1
# Licensed under the MIT license
2
# http://opensource.org/licenses/mit-license.php
4
# Copyright 2006, Frank Scholz <coherence@beebits.net>
6
# RenderingControl service
8
from twisted.web import resource
10
from coherence.upnp.core.soap_service import UPnPPublisher
12
from coherence.upnp.core import service
14
class RenderingControlControl(service.ServiceControl,UPnPPublisher):
16
def __init__(self, server):
18
self.variables = server.get_variables()
19
self.actions = server.get_actions()
22
class RenderingControlServer(service.ServiceServer, resource.Resource):
24
def __init__(self, device, backend=None):
27
backend = self.device.backend
28
resource.Resource.__init__(self)
29
service.ServiceServer.__init__(self, 'RenderingControl', self.device.version, backend)
31
self.control = RenderingControlControl(self)
32
self.putChild(self.scpd_url, service.scpdXML(self, self.control))
33
self.putChild(self.control_url, self.control)
35
def listchilds(self, uri):
37
for c in self.children:
38
cl += '<li><a href=%s/%s>%s</a></li>' % (uri,c,c)
41
def render(self,request):
42
return '<html><p>root of the RenderingControl</p><p><ul>%s</ul></p></html>'% self.listchilds(request.uri)