Fixed Bug #833786 (spurious brackets not handled correctly).

This commit is contained in:
Jeremy Fincher 2003-10-31 18:18:04 +00:00
parent ca8b17f909
commit 8c93488146
2 changed files with 13 additions and 3 deletions

View File

@ -85,7 +85,10 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
def __init__(self):
callbacks.Privmsg.__init__(self)
setattr(self.__class__, 'exec', self.__class__._exec)
self.defaultPlugins = {'join', 'admin'}
self.defaultPlugins = {'join': 'admin',
'load': 'owner',
'reload': 'owner',
'unload': 'owner'}
def _disambiguate(self, tokens):
if tokens:
@ -100,7 +103,11 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
callbacks.Privmsg.handled = False
s = callbacks.addressed(irc.nick, msg)
if s:
try:
tokens = callbacks.tokenize(s)
except SyntaxError, e:
irc.queueMsg(callbacks.error(msg, str(e)))
return
self._disambiguate(tokens)
ambiguousCommands = {}
commands = callbacks.getCommands(tokens)

View File

@ -297,6 +297,9 @@ class PrivmsgTestCase(ChannelPluginTestCase):
finally:
conf.commandsOnStart = original
def testSyntaxErrorNotEscaping(self):
self.assertError('load [foo')
self.assertError('load foo]')
class PrivmsgCommandAndRegexpTestCase(PluginTestCase):