Plugin system updates

This commit is contained in:
Andrew Resch 2008-07-18 23:46:57 +00:00
parent dde58e80d7
commit 0ccfb483ba
2 changed files with 12 additions and 4 deletions

View File

@ -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()

View File

@ -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):