mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 03:33:11 +01:00
Added a few more asserts and clarified an already existing one.
This commit is contained in:
parent
3a0d71c15a
commit
27656e5fef
@ -124,6 +124,8 @@ class Owner(callbacks.Plugin):
|
||||
# This plugin must be first; its priority must be lowest; otherwise odd
|
||||
# things will happen when adding callbacks.
|
||||
def __init__(self, irc=None):
|
||||
if irc is not None:
|
||||
assert not irc.getCallback(self.name())
|
||||
self.__parent = super(Owner, self)
|
||||
self.__parent.__init__(irc)
|
||||
# Setup log object/command.
|
||||
@ -254,7 +256,8 @@ class Owner(callbacks.Plugin):
|
||||
do422 = do377 = do376
|
||||
|
||||
def doPrivmsg(self, irc, msg):
|
||||
assert self is irc.callbacks[0], 'Owner isn\'t first callback.'
|
||||
assert self is irc.callbacks[0], \
|
||||
'Owner isn\'t first callback: %r' % irc.callbacks
|
||||
if ircmsgs.isCtcp(msg):
|
||||
return
|
||||
s = callbacks.addressed(irc.nick, msg)
|
||||
|
@ -629,6 +629,7 @@ class Irc(IrcCommandDispatcher):
|
||||
# This *isn't* threadsafe!
|
||||
def addCallback(self, callback):
|
||||
"""Adds a callback to the callbacks list."""
|
||||
assert not self.getCallback(callback.name())
|
||||
self.callbacks.append(callback)
|
||||
# This is the new list we're building, which will be tsorted.
|
||||
cbs = []
|
||||
|
Loading…
Reference in New Issue
Block a user