Browse Source

expand the Storage* stuff to include the required attributes..

[git-p4: depot-paths = "//depot/": change = 739]
replace/4e84fdb41ea781c7a8f872baa423e8b3be4045a7
John-Mark Gurney 19 years ago
parent
commit
1c322e3832
1 changed files with 45 additions and 0 deletions
  1. +45
    -0
      DIDLLite.py

+ 45
- 0
DIDLLite.py View File

@@ -267,12 +267,57 @@ class MovieGenre(Genre):
class StorageSystem(Container):
klass = Container.klass + '.storageSystem'

total = -1
used = -1
free = -1
maxpartition = -1
medium = 'UNKNOWN'

def toElement(self):

root = Container.toElement(self)
SubElement(root, 'upnp:storageTotal').text = str(self.total)
SubElement(root, 'upnp:storageUsed').text = str(self.used)
SubElement(root, 'upnp:storageFree').text = str(self.free)
SubElement(root, 'upnp:storageMaxPartition').text = str(self.maxpartition)
SubElement(root, 'upnp:storageMedium').text = self.medium

return root

class StorageVolume(Container):
klass = Container.klass + '.storageVolume'

total = -1
used = -1
free = -1
medium = 'UNKNOWN'

def toElement(self):

root = Container.toElement(self)
SubElement(root, 'upnp:storageTotal').text = str(self.total)
SubElement(root, 'upnp:storageUsed').text = str(self.used)
SubElement(root, 'upnp:storageFree').text = str(self.free)
SubElement(root, 'upnp:storageMedium').text = self.medium

return root

class StorageFolder(Container):
klass = Container.klass + '.storageFolder'

used = -1

def toElement(self):

root = Container.toElement(self)
if self.used is not None:
SubElement(root, 'upnp:storageUsed').text = str(self.used)

return root

class DIDLElement(_ElementInterface):
def __init__(self):
_ElementInterface.__init__(self, 'DIDL-Lite', {})


Loading…
Cancel
Save