add cvsignore
[enigma2.git] / lib / python / Plugins / Extensions / PicturePlayer / plugin.py
index bb8edd6edff197a50d7e01739af99198fcffba6b..34e8c10f471e017e021d224458ef6f3cce1e13d0 100644 (file)
@@ -1,5 +1,4 @@
-from enigma import *
-
+from enigma import eTimer, loadPic, getExif
 from Screens.Screen import Screen
 from Screens.ServiceInfo import ServiceInfoList, ServiceInfoListEntry
 from Components.ActionMap import ActionMap, NumberActionMap
@@ -15,7 +14,6 @@ from Components.AVSwitch import AVSwitch
 
 from Plugins.Plugin import PluginDescriptor
 
-
 config.pic = ConfigSubsection()
 config.pic.slidetime = ConfigInteger(default=10, limits=(5, 60))
 config.pic.resize = ConfigSelection(default="0", choices = [("0", _("simple")), ("1", _("better"))])
@@ -532,5 +530,26 @@ class picmain(Screen):
 def main(session, **kwargs):
        session.open(picmain)
 
+def filescan_open(list, session, **kwargs):
+       session.open(picmain) # list
+
+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"], 
+                       paths_to_scan = 
+                               [
+                                       ScanPath(path = "DCIM", with_subdirs = True),
+                                       ScanPath(path = "", with_subdirs = False),
+                               ],
+                       name = "Pictures", 
+                       description = "View Photos...",
+                       openfnc = filescan_open,
+               )
+
 def Plugins(**kwargs):
-       return PluginDescriptor(name="PicturePlayer", description="Picture Viewer (BMP, PNG, JPG)", icon="pictureplayer.png", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main)
+       return \
+               [PluginDescriptor(name="PicturePlayer", description="Picture Viewer (BMP, PNG, JPG)", icon="pictureplayer.png", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main),
+                PluginDescriptor(name="PicturePlayer", where = PluginDescriptor.WHERE_FILESCAN, fnc = filescan)]