Plugin system updates
This commit is contained in:
parent
dde58e80d7
commit
0ccfb483ba
@ -49,3 +49,7 @@ class PluginBase:
|
|||||||
except Exception, e:
|
except Exception, e:
|
||||||
log.warning("Unable to disable plugin: %s", e)
|
log.warning("Unable to disable plugin: %s", e)
|
||||||
|
|
||||||
|
def update(self):
|
||||||
|
if hasattr(self.plugin, "update"):
|
||||||
|
self.plugin.update()
|
||||||
|
|
||||||
|
|||||||
@ -73,12 +73,16 @@ class PluginManager(deluge.pluginmanagerbase.PluginManagerBase,
|
|||||||
# Disable the plugins
|
# Disable the plugins
|
||||||
self.disable_plugins()
|
self.disable_plugins()
|
||||||
|
|
||||||
|
def update(self):
|
||||||
|
# We call the plugins' update() method every second
|
||||||
|
for plugin in self.plugins.values():
|
||||||
|
if hasattr(plugin, "update"):
|
||||||
|
plugin.update()
|
||||||
|
|
||||||
def _on_get_enabled_plugins(self, enabled_plugins):
|
def _on_get_enabled_plugins(self, enabled_plugins):
|
||||||
log.debug("Core has these plugins enabled: %s", enabled_plugins)
|
log.debug("Core has these plugins enabled: %s", enabled_plugins)
|
||||||
self.config["enabled_plugins"] = enabled_plugins
|
for plugin in enabled_plugins:
|
||||||
|
self.enable_plugin(plugin)
|
||||||
# Enable the plugins that are enabled in the config and core
|
|
||||||
self.enable_plugins()
|
|
||||||
|
|
||||||
## Hook functions
|
## Hook functions
|
||||||
def run_on_show_prefs(self):
|
def run_on_show_prefs(self):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user