add WHERE_SESSIONSTART
authorFelix Domke <tmbinc@elitedvb.net>
Sun, 5 Mar 2006 22:38:47 +0000 (22:38 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Sun, 5 Mar 2006 22:38:47 +0000 (22:38 +0000)
lib/python/Plugins/Plugin.py
mytest.py

index 2c8d929..71b665b 100644 (file)
@@ -28,6 +28,10 @@ class PluginDescriptor:
        # start as wizard. In that case, fnc must be a screen class!
        WHERE_WIZARD = 6
        
+       # like autostart, but for a session. currently, only session starts are 
+       # delivered, and only on pre-loaded plugins
+       WHERE_SESSIONSTART = 7
+       
        def __init__(self, name = "Plugin", where = [ ], description = "", icon = None, fnc = None):
                self.name = name
                if type(where) is list:
index 680f198..448076c 100644 (file)
--- a/mytest.py
+++ b/mytest.py
@@ -94,6 +94,9 @@ class Session:
                self.dialog_stack = [ ]
                self.summary_stack = [ ]
                self.summary = None
+               
+               for p in plugins.getPlugins(PluginDescriptor.WHERE_SESSIONSTART):
+                       p(reason=0, session=self)
        
        def processDelay(self):
                self.execEnd()
@@ -303,9 +306,9 @@ class VolumeControl:
                        self.muteDialog.hide()
 
 def runScreenTest():
-       session = Session(desktop = getDesktop(0), summary_desktop = getDesktop(1), navigation = Navigation())
-
        plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
+
+       session = Session(desktop = getDesktop(0), summary_desktop = getDesktop(1), navigation = Navigation())
        
        screensToRun = [ ]