mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 19:22:45 +01:00
Reverted back to non-exception-raising irc.error.
This commit is contained in:
parent
952b7b6517
commit
806a45a936
@ -265,13 +265,15 @@ class IrcObjectProxy:
|
||||
if isinstance(self.irc, self.__class__):
|
||||
self.irc.reply(msg, s)
|
||||
else:
|
||||
if ircutils.funkyArgument(s):
|
||||
s = repr(s)
|
||||
self.irc.queueMsg(reply(msg, s))
|
||||
else:
|
||||
self.args[self.counter] = s
|
||||
self.evalArgs()
|
||||
|
||||
def error(self, msg, s):
|
||||
raise Error, s
|
||||
self.reply(msg, 'Error: ' + s)
|
||||
|
||||
def killProxy(self):
|
||||
if not isinstance(self.irc, irclib.Irc):
|
||||
@ -288,10 +290,6 @@ class IrcObjectProxy:
|
||||
return getattr(self.irc, attr)
|
||||
|
||||
|
||||
class IrcObjectProxyThreaded(IrcObjectProxy):
|
||||
def error(self, msg, s):
|
||||
self.reply(msg, 'Error: ' + s)
|
||||
|
||||
class CommandThread(threading.Thread):
|
||||
def __init__(self, command, irc, msg, args):
|
||||
name = '%s.%s with args %r' % (command.im_class.__name__,
|
||||
@ -319,9 +317,6 @@ class Privmsg(irclib.IrcCallback):
|
||||
commandArgs = ['self', 'irc', 'msg', 'args']
|
||||
def __init__(self):
|
||||
self.rateLimiter = RateLimiter()
|
||||
if self.threaded:
|
||||
self.Proxy = IrcObjectProxyThreaded
|
||||
else:
|
||||
self.Proxy = IrcObjectProxy
|
||||
|
||||
def __call__(self, irc, msg):
|
||||
@ -379,7 +374,7 @@ class IrcObjectProxyRegexp:
|
||||
self.irc = irc
|
||||
|
||||
def error(self, msg, s):
|
||||
raise Error, s
|
||||
self.reply(msg, 'Error: ' + s)
|
||||
|
||||
def reply(self, msg, s):
|
||||
self.irc.queueMsg(reply(msg, s))
|
||||
@ -388,11 +383,6 @@ class IrcObjectProxyRegexp:
|
||||
return getattr(self.irc, attr)
|
||||
|
||||
|
||||
class IrcObjectProxyRegexpThreaded(IrcObjectProxyRegexp):
|
||||
def error(self, msg, s):
|
||||
self.irc.queueMsg(reply(msg, 'Error: ' + s))
|
||||
|
||||
|
||||
class PrivmsgRegexp(Privmsg):
|
||||
"""A class to allow a person to create regular expression callbacks.
|
||||
|
||||
@ -417,9 +407,6 @@ class PrivmsgRegexp(Privmsg):
|
||||
flags = re.I
|
||||
def __init__(self):
|
||||
Privmsg.__init__(self)
|
||||
if self.threaded:
|
||||
self.Proxy = IrcObjectProxyRegexpThreaded
|
||||
else:
|
||||
self.Proxy = IrcObjectProxyRegexp
|
||||
self.res = []
|
||||
#for name, value in self.__class__.__dict__.iteritems():
|
||||
|
Loading…
Reference in New Issue
Block a user