|
|
@@ -64,13 +64,13 @@ class ContentDirectoryControl(UPnPPublisher, dict): |
|
|
|
assert isinstance(self[item], Container) |
|
|
|
return self.children[item][:] |
|
|
|
|
|
|
|
def __init__(self, title, *args): |
|
|
|
def __init__(self, title, *args, **kwargs): |
|
|
|
super(ContentDirectoryControl, self).__init__(*args) |
|
|
|
fakeparent = '-1' |
|
|
|
self.nextID = 0 |
|
|
|
self.children = { fakeparent: []} |
|
|
|
self[fakeparent] = Container(None, None, '-1', 'fake') |
|
|
|
root = self.addContainer(fakeparent, title) |
|
|
|
root = self.addContainer(fakeparent, title, **kwargs) |
|
|
|
assert root == '0' |
|
|
|
del self[fakeparent] |
|
|
|
del self.children[fakeparent] |
|
|
@@ -227,8 +227,8 @@ class ContentDirectoryControl(UPnPPublisher, dict): |
|
|
|
(`ContainerID`, `ObjectID`)) |
|
|
|
|
|
|
|
class ContentDirectoryServer(resource.Resource): |
|
|
|
def __init__(self, title): |
|
|
|
def __init__(self, title, *args, **kwargs): |
|
|
|
resource.Resource.__init__(self) |
|
|
|
self.putChild('scpd.xml', static.File('content-directory-scpd.xml')) |
|
|
|
self.control = ContentDirectoryControl(title) |
|
|
|
self.control = ContentDirectoryControl(title, *args, **kwargs) |
|
|
|
self.putChild('control', self.control) |