Fix bug involving plugin duplicate names
This commit is contained in:
parent
15d0e7c6fd
commit
019f13fe8d
@ -62,17 +62,20 @@ def enable(name, onionr = None, start_event = True):
|
|||||||
|
|
||||||
if exists(name):
|
if exists(name):
|
||||||
enabled_plugins = get_enabled_plugins()
|
enabled_plugins = get_enabled_plugins()
|
||||||
enabled_plugins.append(name)
|
if not name in enabled_plugins:
|
||||||
config_plugins = config.get('plugins')
|
enabled_plugins.append(name)
|
||||||
config_plugins['enabled'] = enabled_plugins
|
config_plugins = config.get('plugins')
|
||||||
config.set('plugins', config_plugins, True)
|
config_plugins['enabled'] = enabled_plugins
|
||||||
|
config.set('plugins', config_plugins, True)
|
||||||
|
|
||||||
events.call(get_plugin(name), 'enable', onionr)
|
events.call(get_plugin(name), 'enable', onionr)
|
||||||
|
|
||||||
if start_event is True:
|
if start_event is True:
|
||||||
start(name)
|
start(name)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
else:
|
else:
|
||||||
logger.error('Failed to enable plugin \"' + name + '\", disabling plugin.')
|
logger.error('Failed to enable plugin \"' + name + '\", disabling plugin.')
|
||||||
disable(name)
|
disable(name)
|
||||||
|
Loading…
Reference in New Issue
Block a user