X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fpython%2FPlugins%2FDemoPlugins%2FTestPlugin%2Fplugin.py;h=4ef4a87df946811937da316af61aee1482514adf;hb=65a7c0d34bf86543475e98a781a93aa59013b6ce;hp=5991f594e12dde81f577dafd5fe756b00d1d8d71;hpb=31fb73a15d12559b15f5506622c3902476d3ea0f;p=vuplus_dvbapp diff --git a/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py b/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py old mode 100644 new mode 100755 index 5991f59..4ef4a87 --- a/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py +++ b/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py @@ -1,16 +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 = """ @@ -29,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, @@ -45,6 +41,19 @@ class Test(Screen): "0": self.keyNumberGlobal }, -1) + #self.onShown.append(self.openTest) + + def openTest(self): + self.session.openWithCallback(self.mycallback, MessageBox, _("Test-Messagebox?")) + +# self.session.open(InputBox) + + def mycallback(self, answer): + print "answer:", answer + if answer: + raise Exception("test-crash") + self.close() + def keyLeft(self): self["text"].left() @@ -62,8 +71,13 @@ class Test(Screen): print "pressed", number self["text"].number(number) -def main(session): +def main(session, **kwargs): 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): + print "You entered", returnValue -def Plugins(): - return PluginDescriptor(name="Test", description="plugin to test some capabilities", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main) +def Plugins(**kwargs): + return PluginDescriptor(name="Test", description="plugin to test some capabilities", where = PluginDescriptor.WHERE_PLUGINMENU, needsRestart = False, fnc=main)