From 958251e457e49c86366beff69662d36f052d4cc7 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Tue, 21 Feb 2006 19:31:56 +0000 Subject: 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 --- lib/python/Plugins/test/plugin.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/python/Plugins') 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): + """ 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 -- cgit v1.2.3