From fd4ba65140eb509a507469febc998a60c42e6031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Bleyel?= Date: Wed, 9 Dec 2020 13:56:14 +0100 Subject: [PATCH] Fix load external plugins #1039 --- plugin/httpserver.py | 4 ++-- plugin/plugin.py | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/plugin/httpserver.py b/plugin/httpserver.py index a73792690..4944bac3f 100644 --- a/plugin/httpserver.py +++ b/plugin/httpserver.py @@ -140,7 +140,7 @@ def buildRootTree(session): os.symlink(hookpath, origwebifpath + "/WebChilds/Toplevel.py") # import modules - # print("[OpenWebif] loading external plugins...") + print("[OpenWebif] loading external plugins...") from Plugins.Extensions.WebInterface.WebChilds.Toplevel import loaded_plugins if len(loaded_plugins) == 0: externals = os.listdir(origwebifpath + "/WebChilds/External") @@ -169,7 +169,7 @@ def buildRootTree(session): if len(loaded_plugins) > 0: for plugin in loaded_plugins: root.putChild2(plugin[0], plugin[1]) - # print("[OpenWebif] plugin '%s' loaded on path '/%s'" % (plugin[2], plugin[0])) + print("[OpenWebif] plugin '%s' loaded on path '/%s'" % (plugin[2], plugin[0])) else: print("[OpenWebif] no plugins to load") return root diff --git a/plugin/plugin.py b/plugin/plugin.py index f1813118a..fea945d5d 100644 --- a/plugin/plugin.py +++ b/plugin/plugin.py @@ -209,7 +209,7 @@ def keyCancel(self): def confplug(session, **kwargs): - session.open(OpenWebifConfig) + session.open(OpenWebifConfig) def IfUpIfDown(reason, **kwargs): @@ -233,10 +233,12 @@ def main_menu(menuid, **kwargs): def Plugins(**kwargs): + p = PluginDescriptor(where=[PluginDescriptor.WHERE_SESSIONSTART], fnc=startSession) + p.weight = 100 #webif should start as last plugin result = [ - PluginDescriptor(where=[PluginDescriptor.WHERE_SESSIONSTART], fnc=startSession), - PluginDescriptor(where=[PluginDescriptor.WHERE_NETWORKCONFIG_READ], fnc=IfUpIfDown), - ] + p, + PluginDescriptor(where=[PluginDescriptor.WHERE_NETWORKCONFIG_READ], fnc=IfUpIfDown), + ] screenwidth = getDesktop(0).size().width() if imagedistro in ("openatv"): result.append(PluginDescriptor(name="OpenWebif", description=_("OpenWebif Configuration"), where=PluginDescriptor.WHERE_MENU, fnc=main_menu))