Skip to content

Commit

Permalink
Fix load external plugins #1039
Browse files Browse the repository at this point in the history
  • Loading branch information
jbleyel committed Dec 9, 2020
1 parent 39bf8c4 commit fd4ba65
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions plugin/httpserver.py
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions plugin/plugin.py
Expand Up @@ -209,7 +209,7 @@ def keyCancel(self):


def confplug(session, **kwargs):
session.open(OpenWebifConfig)
session.open(OpenWebifConfig)


def IfUpIfDown(reason, **kwargs):
Expand All @@ -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))
Expand Down

0 comments on commit fd4ba65

Please sign in to comment.