diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2006-03-04 19:27:05 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2006-03-04 19:27:05 +0000 |
| commit | d1de2263e4fff409a8fa16fc0069a923b4eff14d (patch) | |
| tree | 5ee24c709870bc09ae709a35fc54eb73ff39f5d7 /lib/python/Plugins/Extensions/ZappingAlternatives | |
| parent | b2cb2cf5a88d2df60af474ced13e3c90891cf841 (diff) | |
| download | enigma2-d1de2263e4fff409a8fa16fc0069a923b4eff14d.tar.gz enigma2-d1de2263e4fff409a8fa16fc0069a923b4eff14d.zip | |
load alternatives.xml in autostart plugin
Diffstat (limited to 'lib/python/Plugins/Extensions/ZappingAlternatives')
| -rw-r--r-- | lib/python/Plugins/Extensions/ZappingAlternatives/plugin.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/python/Plugins/Extensions/ZappingAlternatives/plugin.py b/lib/python/Plugins/Extensions/ZappingAlternatives/plugin.py index fe217289..25acc43f 100644 --- a/lib/python/Plugins/Extensions/ZappingAlternatives/plugin.py +++ b/lib/python/Plugins/Extensions/ZappingAlternatives/plugin.py @@ -36,6 +36,16 @@ def removeAlternative(service1, service2): del alternatives[service1] if len(alternatives[service2]) == 0: del alternatives[service2] + +def loadAlternatives(): + doc = xml.dom.minidom.parse(self.filename) + + root = doc.childNodes[0] + for service in elementsWithTag(root.childNodes, 'service'): + newService = str(service.getAttribute('ref')) + for alternative in elementsWithTag(service.childNodes, 'alternative'): + newAlternative = str(alternative.getAttribute('ref')) + addAlternative(newService, newAlternative) def sortKey(x): return str.lower(ServiceReference(x).getServiceName().strip()) @@ -235,6 +245,7 @@ def playService(self, ref): def autostart(reason): if reason == 0: + loadAlternatives() NavigationInstance.instance.playService = type(NavigationInstance.instance.playService)(playService, NavigationInstance, Navigation) def AlternativeZappingSetup(session): |
