From 20e972ec1f78e204227ebdccfbd3ccf4b645ddd3 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sat, 31 Jul 2004 06:15:19 +0000 Subject: [PATCH] Fixed bugs in defaultplugin. --- src/Owner.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Owner.py b/src/Owner.py index d05120617..cd9d44e42 100644 --- a/src/Owner.py +++ b/src/Owner.py @@ -401,21 +401,21 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg): (command, plugin) = privmsgs.getArgs(rest, optional=1) command = callbacks.canonicalName(command) cbs = callbacks.findCallbackForCommand(irc, command) - def isDispatcher(cb): - name = callbacks.canonicalName(getattr(cb, 'name')()) - return getattr(cb, name).isDispatcher - # Ensure someone isn't trying to use a plugin for their command - cbs = [cb for cb in cbs if not isDispatcher(cb)] if remove: try: conf.supybot.commands.defaultPlugins.unregister(command) irc.replySuccess() except registry.NonExistentRegistryEntry: - raise callbacks.ArgumentError + s = 'I don\'t have a default plugin set for that command.' + irc.error(s) elif not cbs: irc.error('That\'s not a valid command.') return elif plugin: + cb = irc.getCallback(plugin) + if cb is None: + irc.error('That\'s not a valid plugin.') + return registerDefaultPlugin(command, plugin) irc.replySuccess() else: