X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FPlugins%2FExtensions%2FPicturePlayer%2Fplugin.py;h=6d41305ea20cd55e56302c8354cedcddffe71146;hp=23c250efcdb931788ae180668b8ff9cc123c1b28;hb=6f73e6abddf4170357c490966d0e1c622eb376f5;hpb=9248bf86cddef4cf3904748bcd94ddabef68f8c7;ds=sidebyside diff --git a/lib/python/Plugins/Extensions/PicturePlayer/plugin.py b/lib/python/Plugins/Extensions/PicturePlayer/plugin.py index 23c250e..6d41305 100644 --- a/lib/python/Plugins/Extensions/PicturePlayer/plugin.py +++ b/lib/python/Plugins/Extensions/PicturePlayer/plugin.py @@ -8,8 +8,8 @@ from Components.Label import Label from Components.ConfigList import ConfigList from Components.config import * -from Tools.Directories import resolveFilename, pathExists, createDir, SCOPE_MEDIA -from Components.FileList import FileEntryComponent, FileList +from Tools.Directories import resolveFilename, fileExists, pathExists, createDir, SCOPE_MEDIA +from Components.FileList import FileList from Components.AVSwitch import AVSwitch from Plugins.Plugin import PluginDescriptor @@ -94,7 +94,7 @@ class ThumbView(Screen): self["label0"].setText(_("no Picture found")) self.ThumbTimer = eTimer() - self.ThumbTimer.timeout.get().append(self.showThumb) + self.ThumbTimer.callback.append(self.showThumb) self.fillPage() @@ -244,11 +244,11 @@ class PicView(Screen): self["pause"] = Pixmap() self.decodeTimer = eTimer() - self.decodeTimer.timeout.get().append(self.decodePic) + self.decodeTimer.callback.append(self.decodePic) self.decodeTimer.start(300, True) self.slideTimer = eTimer() - self.slideTimer.timeout.get().append(self.slidePic) + self.slideTimer.callback.append(self.slidePic) def Pause(self): @@ -452,12 +452,12 @@ class picmain(Screen): if not pathExists(currDir): currDir = "/" - self.filelist = FileList(currDir, matchingPattern = "(?i)^.*\.(jpeg|jpg|png|bmp)") + self.filelist = FileList(currDir, matchingPattern = "(?i)^.*\.(jpeg|jpg|jpe|png|bmp)") self["filelist"] = self.filelist self["thumbnail"] = Pixmap() self.ThumbTimer = eTimer() - self.ThumbTimer.timeout.get().append(self.showThumb) + self.ThumbTimer.callback.append(self.showThumb) self.ThumbTimer.start(500, True) def up(self): @@ -531,14 +531,20 @@ def main(session, **kwargs): session.open(picmain) def filescan_open(list, session, **kwargs): - session.open(picmain) # list + # Recreate List as expected by PicView + filelist = [((file.path, False), None) for file in list] + session.open(PicView, filelist, "", "") + +def filescan(**kwargs): + from Components.Scanner import Scanner, ScanPath + + # Overwrite checkFile to only detect local + class LocalScanner(Scanner): + def checkFile(self, file): + return fileExists(file.path) -def filescan(): - # we expect not to be called if the MediaScanner plugin is not available, - # thus we don't catch an ImportError exception here - from Plugins.Extensions.MediaScanner.plugin import Scanner, ScanPath return \ - Scanner(extensions = ["jpg", "jpe", "jpeg"], + LocalScanner(mimetypes = ["image/jpeg", "image/png", "image/gif", "image/bmp"], paths_to_scan = [ ScanPath(path = "DCIM", with_subdirs = True),