|
|
@@ -394,6 +394,16 @@ class Container(Object, list): |
|
|
|
self.updateID = (self.updateID + 1) % (1l << 32) |
|
|
|
Container.didUpdate(self.cd['0']) |
|
|
|
|
|
|
|
def _addSet(self, e, items): |
|
|
|
if items is not None: |
|
|
|
if not isinstance(items, (list, tuple)): |
|
|
|
items = [ items ] |
|
|
|
for i in items: |
|
|
|
el = SubElement(root, e) |
|
|
|
el.text = i |
|
|
|
# XXX - how to specify? |
|
|
|
el.attrib['includeDerived'] = '1' |
|
|
|
|
|
|
|
def toElement(self): |
|
|
|
|
|
|
|
root = Object.toElement(self) |
|
|
@@ -403,14 +413,8 @@ class Container(Object, list): |
|
|
|
if self.childCount: |
|
|
|
root.attrib['childCount'] = str(self.childCount) |
|
|
|
|
|
|
|
if self.createClass is not None: |
|
|
|
SubElement(root, 'upnp:createclass').text = self.createClass |
|
|
|
|
|
|
|
if self.searchClass is not None: |
|
|
|
if not isinstance(self.searchClass, (list, tuple)): |
|
|
|
self.searchClass = ['searchClass'] |
|
|
|
for i in searchClass: |
|
|
|
SubElement(root, 'upnp:searchclass').text = i |
|
|
|
self._addSet('upnp:createclass', self.createClass) |
|
|
|
self._addSet('upnp:searchclass', self.searchClass) |
|
|
|
|
|
|
|
if self.searchable is not None: |
|
|
|
root.attrib['searchable'] = str(self.searchable) |
|
|
|