From 71926516a90b5252f39271334760de686fb8c72f Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Tue, 21 Feb 2006 22:07:56 +0000 Subject: [PATCH] add WHERE_WIZARD plugins --- lib/python/Plugins/Plugin.py | 3 +++ mytest.py | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/python/Plugins/Plugin.py b/lib/python/Plugins/Plugin.py index d10a3fba..d3635091 100644 --- a/lib/python/Plugins/Plugin.py +++ b/lib/python/Plugins/Plugin.py @@ -21,6 +21,9 @@ class PluginDescriptor: # reason (0: start, 1: end) WHERE_AUTOSTART = 5 + # start as wizard. In that case, fnc must be a screen class! + WHERE_WIZARD = 6 + def __init__(self, name = "Plugin", where = [ ], description = "", icon = None, fnc = None): self.name = name if type(where) is list: diff --git a/mytest.py b/mytest.py index 8ae28ab8..9d2998ba 100644 --- a/mytest.py +++ b/mytest.py @@ -29,7 +29,7 @@ try: def runReactor(): reactor.run() -except: +except ImportError: print "twisted not available" def runReactor(): runMainloop() @@ -42,6 +42,7 @@ from Screens.Wizard import wizardManager from Screens.StartWizard import * from Screens.TutorialWizard import * from Tools.BoundFunction import boundFunction +from Plugins.Plugin import PluginDescriptor had = dict() @@ -271,11 +272,13 @@ def runScreenTest(): session.nav = Navigation() screensToRun = wizardManager.getWizards() + for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD): + screensToRun.append(p.__call__) screensToRun.append(Screens.InfoBar.InfoBar) def runNextScreen(session, screensToRun, *result): if result: - quitMainloop(result) + quitMainloop(*result) screen = screensToRun[0] -- 2.30.2