Owner: Fix bug with @enable and @disable if a plugin is given. Closes GH-43. Closes GH-44.

This commit is contained in:
Valentin Lorentz 2011-06-29 13:56:22 +02:00
parent 08175fc920
commit 5275d708e5

View File

@ -540,11 +540,11 @@ class Owner(callbacks.Plugin):
if plugin.isCommand(command): if plugin.isCommand(command):
pluginCommand = '%s.%s' % (plugin.name(), command) pluginCommand = '%s.%s' % (plugin.name(), command)
conf.supybot.commands.disabled().add(pluginCommand) conf.supybot.commands.disabled().add(pluginCommand)
plugin._disabled.add(command)
else: else:
irc.error('%s is not a command in the %s plugin.' % irc.error('%s is not a command in the %s plugin.' %
(command, plugin.name())) (command, plugin.name()))
return return
self._disabled.add(pluginCommand, plugin.name())
else: else:
conf.supybot.commands.disabled().add(command) conf.supybot.commands.disabled().add(command)
self._disabled.add(command) self._disabled.add(command)
@ -560,8 +560,8 @@ class Owner(callbacks.Plugin):
""" """
try: try:
if plugin: if plugin:
plugin._disabled.remove(command, plugin.name())
command = '%s.%s' % (plugin.name(), command) command = '%s.%s' % (plugin.name(), command)
self._disabled.remove(command, plugin.name())
else: else:
self._disabled.remove(command) self._disabled.remove(command)
conf.supybot.commands.disabled().remove(command) conf.supybot.commands.disabled().remove(command)