aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Plugins/test
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-02-21 19:31:56 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-02-21 19:31:56 +0000
commit958251e457e49c86366beff69662d36f052d4cc7 (patch)
treed27c4219726df2a1e7f73cd9901efd2a594a4a1b /lib/python/Plugins/test
parentf458abcfbe30c3e3062a41b88d3244147bdc0607 (diff)
downloadenigma2-958251e457e49c86366beff69662d36f052d4cc7.tar.gz
enigma2-958251e457e49c86366beff69662d36f052d4cc7.zip
add ability to use regular expressions to filter files to display in the FileList
transform the test plugin into an image viewer for png files
Diffstat (limited to 'lib/python/Plugins/test')
-rw-r--r--lib/python/Plugins/test/plugin.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/python/Plugins/test/plugin.py b/lib/python/Plugins/test/plugin.py
index 0a375335..668515f4 100644
--- a/lib/python/Plugins/test/plugin.py
+++ b/lib/python/Plugins/test/plugin.py
@@ -5,6 +5,7 @@ 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
@@ -15,13 +16,15 @@ class Test(Screen):
<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("/")
-
+ self["list"] = FileList("/", matchingPattern = "^.*\.png")
+ self["pixmap"] = Pixmap()
+
#self["text"] = Input("1234", maxSize=True, type=Input.NUMBER)
self["actions"] = NumberActionMap(["WizardActions", "InputActions"],
@@ -52,6 +55,8 @@ class Test(Screen):
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