1 from Screens.Screen import Screen
2 from Components.ActionMap import NumberActionMap
3 from Components.Pixmap import Pixmap
4 from Components.FileList import FileList
5 from Plugins.Plugin import PluginDescriptor
7 class FileManager(Screen):
9 <screen position="100,100" size="550,400" title="Test" >
10 <!--widget name="text" position="0,0" size="550,25" font="Regular;20" /-->
11 <widget name="list" position="10,0" size="190,250" scrollbarMode="showOnDemand" />
12 <widget name="pixmap" position="200,0" size="190,250" alphatest="on" />
14 def __init__(self, session, args = None):
15 self.skin = FileManager.skin
16 Screen.__init__(self, session)
18 self["list"] = FileList("/", matchingPattern = "^.*\.(png|avi|mp3|mpeg|ts)", useServiceRef = True)
19 self["pixmap"] = Pixmap()
21 #self["text"] = Input("1234", maxSize=True, type=Input.NUMBER)
23 self["actions"] = NumberActionMap(["WizardActions", "InputActions"],
27 # "left": self.keyLeft,
28 # "right": self.keyRight,
29 "1": self.keyNumberGlobal,
30 "2": self.keyNumberGlobal,
31 "3": self.keyNumberGlobal,
32 "4": self.keyNumberGlobal,
33 "5": self.keyNumberGlobal,
34 "6": self.keyNumberGlobal,
35 "7": self.keyNumberGlobal,
36 "8": self.keyNumberGlobal,
37 "9": self.keyNumberGlobal,
38 "0": self.keyNumberGlobal
49 if self["list"].canDescent(): # isDir
50 self["list"].descent()
52 self["pixmap"].instance.setPixmapFromFile(self["list"].getFilename())
54 def keyNumberGlobal(self, number):
55 print "pressed", number
56 self["text"].number(number)
58 def main(session, **kwargs):
59 session.open(FileManager)
61 def Plugins(**kwargs):
62 return [PluginDescriptor(name="File-Manager", description="Let's you view/edit files in your Dreambox", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main),
63 PluginDescriptor(name="File-Manager", description="Let's you view/edit files in your Dreambox", where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc=main)]