Fix starting plugins when enabled

This commit is contained in:
Andrew Resch 2009-07-06 05:18:18 +00:00
parent cdddc38780
commit efa125ac83
1 changed files with 4 additions and 2 deletions

View File

@ -44,6 +44,8 @@ import deluge.common
import deluge.configmanager import deluge.configmanager
from deluge.log import LOG as log from deluge.log import LOG as log
import deluge.component as component
METADATA_KEYS = [ METADATA_KEYS = [
"Name", "Name",
"License", "License",
@ -132,8 +134,8 @@ class PluginManagerBase:
log.error("Unable to instantiate plugin!") log.error("Unable to instantiate plugin!")
log.exception(e) log.exception(e)
instance.enable() instance.enable()
if self.get_state() == "Started": if self.get_state() == component.COMPONENT_STATE.index("Started"):
component.start(instance.get_component_name()) component.start(instance.plugin.get_component_name())
plugin_name = plugin_name.replace("-", " ") plugin_name = plugin_name.replace("-", " ")
self.plugins[plugin_name] = instance self.plugins[plugin_name] = instance
if plugin_name not in self.config["enabled_plugins"]: if plugin_name not in self.config["enabled_plugins"]: