diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2006-02-22 22:14:19 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2006-02-22 22:14:19 +0000 |
| commit | 31fb73a15d12559b15f5506622c3902476d3ea0f (patch) | |
| tree | 6f79a930ca7e4f16f5f5e84a3e5bd8fdfc0c5cf3 /lib/python/Plugins/DemoPlugins | |
| parent | 3613b3f0a365a6cfe83357754db892981c897bed (diff) | |
| download | enigma2-31fb73a15d12559b15f5506622c3902476d3ea0f.tar.gz enigma2-31fb73a15d12559b15f5506622c3902476d3ea0f.zip | |
cleanup the plugins to fit the new namespace
Diffstat (limited to 'lib/python/Plugins/DemoPlugins')
4 files changed, 76 insertions, 0 deletions
diff --git a/lib/python/Plugins/DemoPlugins/Makefile.am b/lib/python/Plugins/DemoPlugins/Makefile.am new file mode 100644 index 00000000..86e98ec2 --- /dev/null +++ b/lib/python/Plugins/DemoPlugins/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = TestPlugin diff --git a/lib/python/Plugins/DemoPlugins/TestPlugin/Makefile.am b/lib/python/Plugins/DemoPlugins/TestPlugin/Makefile.am new file mode 100644 index 00000000..dd6980ac --- /dev/null +++ b/lib/python/Plugins/DemoPlugins/TestPlugin/Makefile.am @@ -0,0 +1,6 @@ +installdir = $(LIBDIR)/enigma2/python/Plugins/TestPlugin + +install_PYTHON = \ + __init__.py \ + plugin.py + diff --git a/lib/python/Plugins/DemoPlugins/TestPlugin/__init__.py b/lib/python/Plugins/DemoPlugins/TestPlugin/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/lib/python/Plugins/DemoPlugins/TestPlugin/__init__.py diff --git a/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py b/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py new file mode 100644 index 00000000..5991f594 --- /dev/null +++ b/lib/python/Plugins/DemoPlugins/TestPlugin/plugin.py @@ -0,0 +1,69 @@ +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 Plugins.Plugin import PluginDescriptor + +import os + +class Test(Screen): + skin = """ + <screen position="100,100" size="550,400" title="Test" > + <!--widget name="text" position="0,0" size="550,25" font="Regular;20" /--> + <widget name="list" position="10,0" size="190,250" scrollbarMode="showOnDemand" /> + <widget name="pixmap" position="200,0" size="190,250" /> + </screen>""" + def __init__(self, session, args = None): + self.skin = Test.skin + Screen.__init__(self, session) + + self["list"] = FileList("/", matchingPattern = "^.*\.(png|avi|mp3|mpeg|ts)") + self["pixmap"] = Pixmap() + + #self["text"] = Input("1234", maxSize=True, type=Input.NUMBER) + + self["actions"] = NumberActionMap(["WizardActions", "InputActions"], + { + "ok": self.ok, + "back": self.close, +# "left": self.keyLeft, +# "right": self.keyRight, + "1": self.keyNumberGlobal, + "2": self.keyNumberGlobal, + "3": self.keyNumberGlobal, + "4": self.keyNumberGlobal, + "5": self.keyNumberGlobal, + "6": self.keyNumberGlobal, + "7": self.keyNumberGlobal, + "8": self.keyNumberGlobal, + "9": self.keyNumberGlobal, + "0": self.keyNumberGlobal + }, -1) + + def keyLeft(self): + self["text"].left() + + def keyRight(self): + self["text"].right() + + def ok(self): + selection = self["list"].getSelection() + if selection[1] == True: # isDir + self["list"].changeDir(selection[0]) + else: + self["pixmap"].instance.setPixmapFromFile(selection[0]) + + def keyNumberGlobal(self, number): + print "pressed", number + self["text"].number(number) + +def main(session): + session.open(Test) + +def Plugins(): + return PluginDescriptor(name="Test", description="plugin to test some capabilities", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main) |
