Changed IrcObjectProxyRegexp to SimpleProxy to more accurately show what the deal is.

This commit is contained in:
Jeremy Fincher 2004-07-31 12:14:13 +00:00
parent a2feec9ac0
commit f349f08111
2 changed files with 6 additions and 4 deletions

View File

@ -114,7 +114,7 @@ class RSS(callbacks.Privmsg):
def __call__(self, irc, msg):
callbacks.Privmsg.__call__(self, irc, msg)
irc = callbacks.IrcObjectProxyRegexp(irc, msg)
irc = callbacks.SimpleProxy(irc, msg)
L = conf.supybot.plugins.RSS.announce.getValues(fullNames=False)
newFeeds = {}
for (channel, v) in L:

View File

@ -824,6 +824,7 @@ class Privmsg(irclib.IrcCallback):
del args[0]
method = getattr(self, name)
try:
realname = '%s.%s' % (canonicalname, name)
method(irc, msg, args)
except (getopt.GetoptError, ArgumentError):
irc.reply(formatArgumentError(method, name))
@ -939,7 +940,7 @@ class Privmsg(irclib.IrcCallback):
group.set(value)
class IrcObjectProxyRegexp(RichReplyMethods):
class SimpleProxy(RichReplyMethods):
def __init__(self, irc, msg):
self.irc = irc
self.msg = msg
@ -959,6 +960,7 @@ class IrcObjectProxyRegexp(RichReplyMethods):
def __getattr__(self, attr):
return getattr(self.irc, attr)
IrcObjectProxyRegexp = SimpleProxy
class PrivmsgRegexp(Privmsg):
"""A class to allow a person to create regular expression callbacks.
@ -981,7 +983,7 @@ class PrivmsgRegexp(Privmsg):
because it's much more easily coded and maintained.
"""
flags = re.I
Proxy = IrcObjectProxyRegexp
Proxy = SimpleProxy
commandArgs = ['self', 'irc', 'msg', 'match']
def __init__(self):
self.__parent = super(PrivmsgRegexp, self)
@ -1035,7 +1037,7 @@ class PrivmsgCommandAndRegexp(Privmsg):
flags = re.I
regexps = ()
addressedRegexps = ()
Proxy = IrcObjectProxyRegexp
Proxy = SimpleProxy
def __init__(self):
self.__parent = super(PrivmsgCommandAndRegexp, self)
self.__parent.__init__()