diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2011-11-11 17:17:21 +0100 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2011-11-11 17:17:21 +0100 |
| commit | ea1e130bea2892a636e80fe0ef6df44324eaabd9 (patch) | |
| tree | 05cc6a435ba230e76b22684925c8b1fe7aa5c26b /src | |
| download | enigma2-curlytx-ea1e130bea2892a636e80fe0ef6df44324eaabd9.tar.gz enigma2-curlytx-ea1e130bea2892a636e80fe0ef6df44324eaabd9.zip | |
plugin shows popup
Diffstat (limited to 'src')
| -rw-r--r-- | src/CurlyTx.py | 36 | ||||
| -rw-r--r-- | src/__init__.py | 0 | ||||
| -rw-r--r-- | src/plugin.py | 28 |
3 files changed, 64 insertions, 0 deletions
diff --git a/src/CurlyTx.py b/src/CurlyTx.py new file mode 100644 index 0000000..8043695 --- /dev/null +++ b/src/CurlyTx.py @@ -0,0 +1,36 @@ +from Screens.Screen import Screen +from Screens.MessageBox import MessageBox +from Components.Label import Label +from Components.Sources.StaticText import StaticText +from Components.ActionMap import NumberActionMap + +class CurlyTx(Screen): + skin = """ + <screen position="100,100" size="550,400" title="Test" > + <widget name="text" position="0,0" size="550,25" font="Regular;20" /> + </screen>""" + + def __init__(self, session, args = None): + self.skin = CurlyTx.skin + Screen.__init__(self, session) + + self["text"] = StaticText("foo") + #sample = file(test).read() + #import urllib + ##req = urllib2.Request(url) + # r = urllib2.urlopen(req) + # f.write(r.read()) + # webFile.close() + #self.session.openWithCallback(self.mycallback, MessageBox, _("Test-Messagebox?")) + + self["actions"] = NumberActionMap(["WizardActions", "InputActions"], { + "ok": self.close, + "back": self.close + }, -1) + + + def mycallback(self, answer): + print "answer:", answer + if answer: + raise Exception("test-crash") + self.close() diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/__init__.py diff --git a/src/plugin.py b/src/plugin.py new file mode 100644 index 0000000..dd0f5cf --- /dev/null +++ b/src/plugin.py @@ -0,0 +1,28 @@ +from Plugins.Plugin import PluginDescriptor +import CurlyTx + +def main(session, **kwargs): + reload(CurlyTx) + try: + session.open(CurlyTx.CurlyTx) + except: + import traceback + traceback.print_exc() + +def menuHook(menuid): + if menuid == "mainmenu": + return [(_("CurlyTx"), main, "curlytx", 1)] + return [ ] + + +def Plugins(**kwargs): + return [ + PluginDescriptor(name = "CurlyTx", + description = "View remote text files", + where = [PluginDescriptor.WHERE_PLUGINMENU], + fnc = main), + PluginDescriptor(name = "CurlyTx", + description = "View remote text files", + where=PluginDescriptor.WHERE_MENU, + fnc = menuHook), + ] |
