mirror of https://github.com/Mikaela/Limnoria.git
Fixed Bug #833786 (spurious brackets not handled correctly).
This commit is contained in:
parent
ca8b17f909
commit
8c93488146
|
@ -85,7 +85,10 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
callbacks.Privmsg.__init__(self)
|
callbacks.Privmsg.__init__(self)
|
||||||
setattr(self.__class__, 'exec', self.__class__._exec)
|
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):
|
def _disambiguate(self, tokens):
|
||||||
if tokens:
|
if tokens:
|
||||||
|
@ -100,7 +103,11 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
|
||||||
callbacks.Privmsg.handled = False
|
callbacks.Privmsg.handled = False
|
||||||
s = callbacks.addressed(irc.nick, msg)
|
s = callbacks.addressed(irc.nick, msg)
|
||||||
if s:
|
if s:
|
||||||
|
try:
|
||||||
tokens = callbacks.tokenize(s)
|
tokens = callbacks.tokenize(s)
|
||||||
|
except SyntaxError, e:
|
||||||
|
irc.queueMsg(callbacks.error(msg, str(e)))
|
||||||
|
return
|
||||||
self._disambiguate(tokens)
|
self._disambiguate(tokens)
|
||||||
ambiguousCommands = {}
|
ambiguousCommands = {}
|
||||||
commands = callbacks.getCommands(tokens)
|
commands = callbacks.getCommands(tokens)
|
||||||
|
|
|
@ -297,6 +297,9 @@ class PrivmsgTestCase(ChannelPluginTestCase):
|
||||||
finally:
|
finally:
|
||||||
conf.commandsOnStart = original
|
conf.commandsOnStart = original
|
||||||
|
|
||||||
|
def testSyntaxErrorNotEscaping(self):
|
||||||
|
self.assertError('load [foo')
|
||||||
|
self.assertError('load foo]')
|
||||||
|
|
||||||
|
|
||||||
class PrivmsgCommandAndRegexpTestCase(PluginTestCase):
|
class PrivmsgCommandAndRegexpTestCase(PluginTestCase):
|
||||||
|
|
Loading…
Reference in New Issue