X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/fb412ff32c7938649c72d55eed3f5c8ccb5e0a99..09f66522e9f51ac8fc7921bd77ba36a9d9d3d4b3:/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py diff --git a/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py b/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py index e074aeec..69f935e4 100644 --- a/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py +++ b/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py @@ -1,17 +1,12 @@ -from enigma import * from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.ActionMap import NumberActionMap -from Components.Label import Label from Components.Input import Input -from Components.GUIComponent import * from Components.Pixmap import Pixmap -from Components.FileList import FileEntryComponent, FileList +from Components.FileList import FileList from Screens.ChoiceBox import ChoiceBox from Plugins.Plugin import PluginDescriptor -import os - class Test(Screen): skin = """ @@ -30,7 +25,7 @@ class Test(Screen): self["actions"] = NumberActionMap(["WizardActions", "InputActions"], { - "ok": self.ok, + "ok": self.openTest, "back": self.close, # "left": self.keyLeft, # "right": self.keyRight, @@ -46,15 +41,17 @@ class Test(Screen): "0": self.keyNumberGlobal }, -1) - self.onShown.append(self.openTest) + #self.onShown.append(self.openTest) def openTest(self): - self.session.openWithCallback(self.callback, MessageBox, _("Test-Messagebox?")) + self.session.openWithCallback(self.mycallback, MessageBox, _("Test-Messagebox?")) # self.session.open(InputBox) - def callback(self, answer): + def mycallback(self, answer): print "answer:", answer + if answer: + raise Exception("test-crash") self.close() def keyLeft(self): @@ -75,7 +72,8 @@ class Test(Screen): self["text"].number(number) def main(session, **kwargs): - session.openWithCallback(test, MessageBox, _("Test-Messagebox?"), timeout = 10) + session.open(Test) + #session.openWithCallback(test, MessageBox, _("Test-Messagebox?"), timeout = 10) #session.openWithCallback(test, ChoiceBox, title="Delete everything on this Dreambox?", list=[(_("yes"), "yes"), (_("no"), "no"), (_("perhaps"), "perhaps"), (_("ask me tomorrow"), "ask me tomorrow"), (_("leave me alone with this!"), "yes")]) def test(returnValue):