From bd23fd647b766a85bdb06f5c43463553476e1338 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Fri, 18 Feb 2005 07:31:51 +0000 Subject: [PATCH] Fixed to make the tests run again with the new refactoring. --- plugins/Alias/plugin.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/Alias/plugin.py b/plugins/Alias/plugin.py index 46c0eb723..dbdd1d1ea 100644 --- a/plugins/Alias/plugin.py +++ b/plugins/Alias/plugin.py @@ -197,7 +197,7 @@ class Alias(callbacks.Plugin): Locks an alias so that no one else can change it. """ - if hasattr(self, name) and self.isCommand(name): + if hasattr(self, name) and self.isCommandMethod(name): self.aliases[name][1] = True conf.supybot.plugins.Alias.aliases.get(name).locked.setValue(True) irc.replySuccess() @@ -210,7 +210,7 @@ class Alias(callbacks.Plugin): Unlocks an alias so that people can define new aliases over it. """ - if hasattr(self, name) and self.isCommand(name): + if hasattr(self, name) and self.isCommandMethod(name): self.aliases[name][1] = False conf.supybot.plugins.Alias.aliases.get(name).locked.setValue(False) irc.replySuccess() @@ -231,9 +231,8 @@ class Alias(callbacks.Plugin): s = format('That name isn\'t valid. Try %q instead.', realName) raise AliasError, s name = realName - cbs = callbacks.findCallbackForCommand(irc, name) - if self in cbs: - if hasattr(self, realName) and realName not in self.aliases: + if self.isCommandMethod(name): + if realName not in self.aliases: s = 'You can\'t overwrite commands in this plugin.' raise AliasError, s if name in self.aliases: @@ -256,7 +255,7 @@ class Alias(callbacks.Plugin): def removeAlias(self, name, evenIfLocked=False): name = callbacks.canonicalName(name) - if hasattr(self, name) and self.isCommand(name): + if hasattr(self, name) and self.isCommandMethod(name): if evenIfLocked or not self.aliases[name][1]: delattr(self.__class__, name) del self.aliases[name]