From 74a9964da2fb37d9a4b24d45a12c846d276ca546 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Thu, 11 Sep 2003 09:10:42 +0000 Subject: [PATCH] Updated PrivmsgCommandAndRegexp to also sort its regexps by their method name. --- src/callbacks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/callbacks.py b/src/callbacks.py index 24df66666..d376c221c 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -578,6 +578,9 @@ class Privmsg(irclib.IrcCallback): if msg: try: args = tokenize(s) + for command in getCommands(args): + if not findCallbackForCommand(irc, command): + return self.Proxy(irc, msg, args) except SyntaxError, e: irc.queueMsg(reply(msg, debug.exnToString(e))) @@ -669,6 +672,7 @@ class PrivmsgCommandAndRegexp(Privmsg): method = getattr(self, name) r = re.compile(method.__doc__, self.flags) self.res.append((r, method)) + self.res.sort(lambda (r1, m1), (r2, m2): cmp(m1.__name__, m2.__name__)) def doPrivmsg(self, irc, msg): if ircdb.checkIgnored(msg.prefix, msg.args[0]):