From: Stefan Pluecken Date: Wed, 22 Feb 2006 22:27:44 +0000 (+0000) Subject: the missing plugin X-Git-Tag: 2.6.0~4051 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/be664ec6f26b751c9163c5767d254ca9ceed5b99 the missing plugin --- diff --git a/lib/python/Plugins/Extensions/FileManager/Makefile.am b/lib/python/Plugins/Extensions/FileManager/Makefile.am new file mode 100644 index 00000000..bf4828d1 --- /dev/null +++ b/lib/python/Plugins/Extensions/FileManager/Makefile.am @@ -0,0 +1,6 @@ +installdir = $(LIBDIR)/enigma2/python/Plugins/FileManager + +install_PYTHON = \ + __init__.py \ + plugin.py + diff --git a/lib/python/Plugins/Extensions/FileManager/__init__.py b/lib/python/Plugins/Extensions/FileManager/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/lib/python/Plugins/Extensions/FileManager/plugin.py b/lib/python/Plugins/Extensions/FileManager/plugin.py new file mode 100644 index 00000000..b7336457 --- /dev/null +++ b/lib/python/Plugins/Extensions/FileManager/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 FileManager(Screen): + skin = """ + + + + + """ + def __init__(self, session, args = None): + self.skin = FileManager.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(FileManager) + +def Plugins(): + return PluginDescriptor(name="File-Manager", description="Let's you view/edit files in your Dreambox", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main)