X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=mytest.py;h=014f94c9a1d40692aba7daf606e1370a8e1bd16d;hp=886efab2fca53b56f9308e69f1d011cfe014ca53;hb=d8bb70354594dddb6ef28f6d41ce733bd9caf4e6;hpb=d630d7d7715a6fbc97c1d322ceb2bc0452ab0740 diff --git a/mytest.py b/mytest.py index 886efab..014f94c 100644 --- a/mytest.py +++ b/mytest.py @@ -321,7 +321,6 @@ class Session: profile("Standby,PowerKey") import Screens.Standby from Screens.Menu import MainMenu, mdom -import xml.dom.minidom from GlobalActions import globalActionMap class PowerKey: @@ -350,21 +349,16 @@ class PowerKey: self.shutdown() elif action == "show_menu": print "Show shutdown Menu" - menu = mdom.childNodes[0] - for x in menu.childNodes: - if x.nodeType != xml.dom.minidom.Element.nodeType: - continue - elif x.tagName == 'menu': - for y in x.childNodes: - if y.nodeType != xml.dom.minidom.Element.nodeType: - continue - elif y.tagName == 'id': - id = y.getAttribute("val") - if id and id == "shutdown": - self.session.infobar = self - menu_screen = self.session.openWithCallback(self.MenuClosed, MainMenu, x, x.childNodes) - menu_screen.setTitle(_("Standby / Restart")) - return + root = mdom.getroot() + for x in root.findall("menu"): + y = x.find("id") + if y is not None: + id = y.get("val") + if id and id == "shutdown": + self.session.infobar = self + menu_screen = self.session.openWithCallback(self.MenuClosed, MainMenu, x) + menu_screen.setTitle(_("Standby / Restart")) + return def powerdown(self): self.standbyblocked = 0