mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-12 04:24:27 +00:00
Plugin system updates
This commit is contained in:
parent
dde58e80d7
commit
0ccfb483ba
@ -49,3 +49,7 @@ class PluginBase:
|
||||
except Exception, 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
|
||||
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):
|
||||
log.debug("Core has these plugins enabled: %s", enabled_plugins)
|
||||
self.config["enabled_plugins"] = enabled_plugins
|
||||
|
||||
# Enable the plugins that are enabled in the config and core
|
||||
self.enable_plugins()
|
||||
for plugin in enabled_plugins:
|
||||
self.enable_plugin(plugin)
|
||||
|
||||
## Hook functions
|
||||
def run_on_show_prefs(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user