summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2016-07-19 15:04:50 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2016-07-19 15:04:50 +0100
commit492ad079654ef88648b9107602a217abf68e9edb (patch)
tree2091a8eef7283fce68a6c414a1479e08a8532f83
parent904a51835b3275b874df33540243624af3751433 (diff)
downloaddeluge-492ad079654ef88648b9107602a217abf68e9edb.tar.gz
deluge-492ad079654ef88648b9107602a217abf68e9edb.tar.bz2
deluge-492ad079654ef88648b9107602a217abf68e9edb.zip
[#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. - Deregister plugin events on json_api disable.
-rw-r--r--deluge/ui/web/json_api.py12
-rw-r--r--deluge/ui/web/pluginmanager.py4
2 files changed, 12 insertions, 4 deletions
diff --git a/deluge/ui/web/json_api.py b/deluge/ui/web/json_api.py
index b1c8ef60d..26f40e9a1 100644
--- a/deluge/ui/web/json_api.py
+++ b/deluge/ui/web/json_api.py
@@ -150,13 +150,21 @@ class JSON(resource.Resource, component.Component):
return d.addCallback(on_client_connected)
def disable(self):
- if not client.is_classicmode():
+ client.deregister_event_handler("PluginEnabledEvent", self.get_remote_methods)
+ client.deregister_event_handler("PluginDisabledEvent", self.get_remote_methods)
+
+ if client.is_classicmode():
+ component.get("Web.PluginManager").stop()
+ else:
client.disconnect()
def enable(self):
client.register_event_handler("PluginEnabledEvent", self.get_remote_methods)
client.register_event_handler("PluginDisabledEvent", self.get_remote_methods)
- if component.get("DelugeWeb").config["default_daemon"]:
+
+ if client.is_classicmode():
+ component.get("Web.PluginManager").start()
+ elif component.get("DelugeWeb").config["default_daemon"]:
# Sort out getting the default daemon here
default = component.get("DelugeWeb").config["default_daemon"]
host = component.get("Web").get_host(default)
diff --git a/deluge/ui/web/pluginmanager.py b/deluge/ui/web/pluginmanager.py
index c2ed75efd..27c02fe96 100644
--- a/deluge/ui/web/pluginmanager.py
+++ b/deluge/ui/web/pluginmanager.py
@@ -83,7 +83,7 @@ class PluginManager(PluginManagerBase, component.Component):
try:
plugin = component.get("WebPlugin." + name)
except KeyError:
- log.info("Plugin has no web ui")
+ log.debug("'%s' plugin contains no WebUI code, ignoring WebUI disable call.", name)
return
info = gather_info(plugin)
@@ -105,7 +105,7 @@ class PluginManager(PluginManagerBase, component.Component):
try:
plugin = component.get("WebPlugin." + name)
except KeyError:
- log.info("Plugin has no web ui")
+ log.info("'%s' plugin contains no WebUI code, ignoring WebUI enable call.", name)
return
info = gather_info(plugin)