[#2293] [WebUI] Fix plugins not loading when using WebUI plugin

- Any plugins that were started before the WebUI plugin would not be loaded
   upon starting the web server and would be not show up. The fix is to use
   web.pluginmanager.start to get all enabled plugins from core.
 - Update log message output for enable/disable in pluginmanager
This commit is contained in:
Calum Lind 2016-05-15 21:20:14 +01:00
parent 46b726a4e0
commit 42e5876ebe
2 changed files with 8 additions and 4 deletions

View File

@ -379,7 +379,9 @@ class WebApi(JSONComponent):
self.sessionproxy = SessionProxy() self.sessionproxy = SessionProxy()
def disable(self): def disable(self):
if not client.is_classicmode(): if client.is_classicmode():
component.get("Web.PluginManager").stop()
else:
client.disconnect() client.disconnect()
client.set_disconnect_callback(None) client.set_disconnect_callback(None)
@ -387,7 +389,9 @@ class WebApi(JSONComponent):
client.register_event_handler("PluginEnabledEvent", self._json.get_remote_methods) client.register_event_handler("PluginEnabledEvent", self._json.get_remote_methods)
client.register_event_handler("PluginDisabledEvent", self._json.get_remote_methods) client.register_event_handler("PluginDisabledEvent", self._json.get_remote_methods)
if not client.is_classicmode(): if client.is_classicmode():
component.get("Web.PluginManager").start()
else:
client.set_disconnect_callback(self._on_client_disconnect) client.set_disconnect_callback(self._on_client_disconnect)
if component.get("DelugeWeb").config["default_daemon"]: if component.get("DelugeWeb").config["default_daemon"]:

View File

@ -59,7 +59,7 @@ class PluginManager(PluginManagerBase, component.Component):
try: try:
plugin = component.get("WebPlugin." + name) plugin = component.get("WebPlugin." + name)
except KeyError: except KeyError:
log.info("Plugin has no web ui") log.debug("'%s' plugin contains no WebUI code, ignoring WebUI disable call.", name)
return return
info = gather_info(plugin) info = gather_info(plugin)
@ -81,7 +81,7 @@ class PluginManager(PluginManagerBase, component.Component):
try: try:
plugin = component.get("WebPlugin." + name) plugin = component.get("WebPlugin." + name)
except KeyError: except KeyError:
log.info("Plugin has no web ui") log.info("'%s' plugin contains no WebUI code, ignoring WebUI enable call.", name)
return return
info = gather_info(plugin) info = gather_info(plugin)