Only enable plugins that are enabled in the core.

This commit is contained in:
Andrew Resch 2007-12-16 11:10:12 +00:00
parent 02fe961a8a
commit 419333b9cb
2 changed files with 2 additions and 3 deletions

View File

@ -87,7 +87,7 @@ class PluginManagerBase:
pkg_resources.working_set.add_entry(plugin_dir) pkg_resources.working_set.add_entry(plugin_dir)
pkg_resources.working_set.add_entry(user_plugin_dir) pkg_resources.working_set.add_entry(user_plugin_dir)
self.pkg_env = pkg_resources.Environment([plugin_dir, user_plugin_dir]) self.pkg_env = pkg_resources.Environment([plugin_dir, user_plugin_dir])
self.available_plugins = [] self.available_plugins = []
for name in self.pkg_env: for name in self.pkg_env:
pkg_name = str(self.pkg_env[name][0]).split()[0].replace("-", " ") pkg_name = str(self.pkg_env[name][0]).split()[0].replace("-", " ")

View File

@ -49,8 +49,7 @@ class PluginManager(deluge.pluginmanagerbase.PluginManagerBase,
"""Start the plugin manager""" """Start the plugin manager"""
# Update the enabled_plugins from the core # Update the enabled_plugins from the core
enabled_plugins = client.get_enabled_plugins() enabled_plugins = client.get_enabled_plugins()
enabled_plugins += self.config["enabled_plugins"] log.debug("Core has these plugins enabled: %s", enabled_plugins)
enabled_plugins = list(set(enabled_plugins))
self.config["enabled_plugins"] = enabled_plugins self.config["enabled_plugins"] = enabled_plugins
# Enable the plugins that are enabled in the config and core # Enable the plugins that are enabled in the config and core