mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Added priority stuff for RFE #799899
This commit is contained in:
parent
0f843dd651
commit
0719bdec92
@ -80,6 +80,7 @@ def subber(m):
|
||||
return nastyChars[:len(m.group(1))]
|
||||
|
||||
class BadWords(callbacks.Privmsg):
|
||||
priority = 1
|
||||
def __init__(self):
|
||||
callbacks.Privmsg.__init__(self)
|
||||
self.badwords = sets.Set()
|
||||
|
@ -162,6 +162,7 @@ example = utils.wrapLines("""
|
||||
""")
|
||||
|
||||
class FunCommands(callbacks.Privmsg):
|
||||
priority = 98 # Really just to test.
|
||||
dictServer = 'dict.org'
|
||||
def __init__(self):
|
||||
callbacks.Privmsg.__init__(self)
|
||||
|
@ -66,6 +66,7 @@ class IrcCallback(IrcCommandDispatcher):
|
||||
"doCommand" -- doPrivmsg, doNick, do433, etc. These will be called
|
||||
on matching messages.
|
||||
"""
|
||||
priority = 99
|
||||
def name(self):
|
||||
return self.__class__.__name__
|
||||
|
||||
@ -368,6 +369,7 @@ class Irc(object):
|
||||
|
||||
def addCallback(self, callback):
|
||||
self.callbacks.append(callback)
|
||||
utils.sortBy(lambda cb: cb.priority, self.callbacks)
|
||||
|
||||
def getCallback(self, name):
|
||||
name = name.lower()
|
||||
@ -409,7 +411,7 @@ class Irc(object):
|
||||
self.outstandingPing = True
|
||||
self.queueMsg(ircmsgs.ping(now))
|
||||
if msg:
|
||||
for callback in self.callbacks:
|
||||
for callback in reviter(self.callbacks):
|
||||
#debug.printf(repr(msg))
|
||||
try:
|
||||
outFilter = getattr(callback, 'outFilter')
|
||||
|
Loading…
Reference in New Issue
Block a user