mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Added a few asserts (the same one three times, actually) to catch old code with a clearer error message.
This commit is contained in:
parent
1c03464fd9
commit
f453d10e9a
@ -447,6 +447,8 @@ class IrcObjectProxy(RichReplyMethods):
|
||||
# These use |= or &= based on whether or not they default to True or
|
||||
# False. Those that default to True use &=; those that default to
|
||||
# False use |=.
|
||||
assert not isinstance(s, ircmsgs.IrcMsg), \
|
||||
'Old code alert: there is no longer a "msg" argument to reply.'
|
||||
msg = self.msg
|
||||
self.action |= action
|
||||
self.notice |= notice
|
||||
@ -581,6 +583,8 @@ class ConfigIrcProxy(RichReplyMethods):
|
||||
self.__dict__['irc'] = irc
|
||||
|
||||
def reply(self, s, *args, **kwargs):
|
||||
assert not isinstance(s, ircmsgs.IrcMsg), \
|
||||
'Old code alert: there is no longer a "msg" argument to reply.'
|
||||
return None
|
||||
|
||||
def error(self, s, *args, **kwargs):
|
||||
@ -738,6 +742,8 @@ class IrcObjectProxyRegexp(RichReplyMethods):
|
||||
self.reply('Error: ' + s, **kwargs)
|
||||
|
||||
def reply(self, s, action=False, **kwargs):
|
||||
assert not isinstance(s, ircmsgs.IrcMsg), \
|
||||
'Old code alert: there is no longer a "msg" argument to reply.'
|
||||
if action:
|
||||
self.irc.queueMsg(ircmsgs.action(ircutils.replyTo(self.msg), s))
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user