autostart and autoend functions are now called on the start and the end of enigma2...
[enigma2.git] / lib / python / Components / PluginComponent.py
index 67373ea7af033a3ec95df33db35a6e54650d47f5..10e1b59d6f6a6a5bc8e0c2b3dcee7122b2cc7228 100644 (file)
@@ -12,7 +12,7 @@ class PluginComponent:
        def setPluginPrefix(self, prefix):
                self.prefix = prefix
 
-       def getPluginList(self):
+       def getPluginList(self, runAutostartPlugins=False, runAutoendPlugins=False):
                list = []
                dir = os.listdir(resolveFilename(SCOPE_PLUGINS))
                self.menuDelete()
@@ -36,6 +36,13 @@ class PluginComponent:
                                                        pass
                
                                                list.append((picturepath, pluginname , x))
+                                               if runAutostartPlugins:
+                                                       try: plugin.autostart()
+                                                       except: pass
+                                               if runAutoendPlugins:
+                                                       try: plugin.autoend()
+                                                       except: pass
+                                                       
                        except:
                                print "Directory", path, "contains a faulty plugin"
                self.menuUpdate()