mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-06 01:24:05 +01:00
Fixed the nesting bug with testEval and testCalc.
This commit is contained in:
parent
e556e783b1
commit
58cf080109
@ -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)
|
||||
|
@ -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):
|
||||
|
@ -35,7 +35,7 @@ import conf
|
||||
import Owner
|
||||
|
||||
class OwnerTestCase(PluginTestCase, PluginDocumentation):
|
||||
plugins = ()
|
||||
plugins = ('Utilities',)
|
||||
def testEval(self):
|
||||
try:
|
||||
originalConfAllowEval = conf.allowEval
|
||||
|
Loading…
Reference in New Issue
Block a user