setupdom = xml.etree.cElementTree.parse(setupfile)
setupfile.close()
+class SetupError(Exception):
+ def __init__(self, message):
+ self.msg = message
+
+ def __str__(self):
+ return self.msg
+
class SetupSummary(Screen):
skin = """
<screen position="6,0" size="120,64">
</screen>"""
def __init__(self, session, parent):
- Screen.__init__(self, session)
+ Screen.__init__(self, session, parent = parent)
self["SetupTitle"] = Label(_(parent.setup_title))
self["SetupEntry"] = Label("")
self["SetupValue"] = Label("")
- self.parent = parent
self.onShow.append(self.addWatcher)
self.onHide.append(self.removeWatcher)
for x in xmldata.findall("setup"):
if x.get("key") == id:
return x.get("title", "").encode("UTF-8")
- raise "unknown setup id '%s'!" % repr(id)
+ raise SetupError("unknown setup id '%s'!" % repr(id))