mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-09 02:54:13 +01:00
Updated PrivmsgCommandAndRegexp to also sort its regexps by their method name.
This commit is contained in:
parent
99f88bd20a
commit
74a9964da2
@ -578,6 +578,9 @@ class Privmsg(irclib.IrcCallback):
|
|||||||
if msg:
|
if msg:
|
||||||
try:
|
try:
|
||||||
args = tokenize(s)
|
args = tokenize(s)
|
||||||
|
for command in getCommands(args):
|
||||||
|
if not findCallbackForCommand(irc, command):
|
||||||
|
return
|
||||||
self.Proxy(irc, msg, args)
|
self.Proxy(irc, msg, args)
|
||||||
except SyntaxError, e:
|
except SyntaxError, e:
|
||||||
irc.queueMsg(reply(msg, debug.exnToString(e)))
|
irc.queueMsg(reply(msg, debug.exnToString(e)))
|
||||||
@ -669,6 +672,7 @@ class PrivmsgCommandAndRegexp(Privmsg):
|
|||||||
method = getattr(self, name)
|
method = getattr(self, name)
|
||||||
r = re.compile(method.__doc__, self.flags)
|
r = re.compile(method.__doc__, self.flags)
|
||||||
self.res.append((r, method))
|
self.res.append((r, method))
|
||||||
|
self.res.sort(lambda (r1, m1), (r2, m2): cmp(m1.__name__, m2.__name__))
|
||||||
|
|
||||||
def doPrivmsg(self, irc, msg):
|
def doPrivmsg(self, irc, msg):
|
||||||
if ircdb.checkIgnored(msg.prefix, msg.args[0]):
|
if ircdb.checkIgnored(msg.prefix, msg.args[0]):
|
||||||
|
Loading…
Reference in New Issue
Block a user