From 58cf080109509d8061962c57a5a55b2f54c10975 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Wed, 29 Oct 2003 23:40:14 +0000 Subject: [PATCH] Fixed the nesting bug with testEval and testCalc. --- src/Misc.py | 1 + src/callbacks.py | 5 +++-- test/test_Owner.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Misc.py b/src/Misc.py index f0026336e..e3604dc7c 100755 --- a/src/Misc.py +++ b/src/Misc.py @@ -52,6 +52,7 @@ import callbacks class Misc(callbacks.Privmsg): priority = sys.maxint def invalidCommand(self, irc, msg, tokens): + #debug.printf('Misc.invalidCommand called') if conf.replyWhenNotCommand: command = tokens and tokens[0] or '' irc.error(msg, '%r is not a valid command.' % command) diff --git a/src/callbacks.py b/src/callbacks.py index 173056b1b..1419d20c6 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -340,7 +340,7 @@ def formatArgumentError(method, name=None): class IrcObjectProxy: "A proxy object to allow proper nested of commands (even threaded ones)." def __init__(self, irc, msg, args): - #debug.printf('__init__: %s' % args) + #debug.printf('IrcObjectProxy.__init__: %s' % args) self.irc = irc self.msg = msg self.args = args @@ -370,6 +370,7 @@ class IrcObjectProxy: def _callInvalidCommands(self): for cb in self.irc.callbacks: + #debug.printf('Trying to call %s.invalidCommand' % cb.name()) if self.finished: break if hasattr(cb, 'invalidCommand'): @@ -381,7 +382,7 @@ class IrcObjectProxy: name = canonicalName(self.args[0]) cbs = findCallbackForCommand(self, name) if len(cbs) == 0: - if self.irc.nick == self.msg.nick: + if self.irc.nick == self.msg.nick and not world.testing: return for cb in self.irc.callbacks: if isinstance(cb, PrivmsgRegexp): diff --git a/test/test_Owner.py b/test/test_Owner.py index 6b5442e40..68b62c0da 100644 --- a/test/test_Owner.py +++ b/test/test_Owner.py @@ -35,7 +35,7 @@ import conf import Owner class OwnerTestCase(PluginTestCase, PluginDocumentation): - plugins = () + plugins = ('Utilities',) def testEval(self): try: originalConfAllowEval = conf.allowEval