From 70d1b1d5d0eb420785e7e3735793b9cb2969fcd6 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 7 Feb 2005 06:28:52 +0000 Subject: [PATCH] Moved _mores to IrcObjectProxy, where it more rightfully belongs. --- plugins/Misc/plugin.py | 6 +++--- plugins/Owner/plugin.py | 2 +- src/callbacks.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/Misc/plugin.py b/plugins/Misc/plugin.py index 549aafa3c..776f6190e 100644 --- a/plugins/Misc/plugin.py +++ b/plugins/Misc/plugin.py @@ -283,9 +283,9 @@ class Misc(callbacks.Privmsg): userHostmask = msg.prefix.split('!', 1)[1] if nick: try: - (private, L) = self._mores[nick] + (private, L) = irc._mores[nick] if not private: - self._mores[userHostmask] = L[:] + irc._mores[userHostmask] = L[:] else: irc.error('%s has no public mores.' % nick) return @@ -293,7 +293,7 @@ class Misc(callbacks.Privmsg): irc.error('Sorry, I can\'t find any mores for %s' % nick) return try: - L = self._mores[userHostmask] + L = irc._mores[userHostmask] chunk = L.pop() if L: chunk += format(' \x02(%n)\x0F', (len(L), 'message', 'more')) diff --git a/plugins/Owner/plugin.py b/plugins/Owner/plugin.py index db33b8988..af1f4fd63 100644 --- a/plugins/Owner/plugin.py +++ b/plugins/Owner/plugin.py @@ -178,7 +178,7 @@ class Owner(callbacks.Privmsg): def reset(self): # This has to be done somewhere, I figure here is as good place as any. - callbacks.Privmsg._mores.clear() + callbacks.IrcObjectProxy._mores.clear() self.__parent.reset() def _connect(self, network, serverPort=None, password=''): diff --git a/src/callbacks.py b/src/callbacks.py index 11b74583c..b5ede03cb 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -539,6 +539,7 @@ _repr = repr class IrcObjectProxy(RichReplyMethods): "A proxy object to allow proper nested of commands (even threaded ones)." + _mores = ircutils.IrcDict() def __init__(self, irc, msg, args, nested=0): assert isinstance(args, list), 'Args should be a list, not a string.' self.irc = irc @@ -858,10 +859,10 @@ class IrcObjectProxy(RichReplyMethods): except KeyError: pass # We'll leave it as it is. mask = prefix.split('!', 1)[1] - Privmsg._mores[mask] = msgs + self._mores[mask] = msgs public = ircutils.isChannel(msg.args[0]) private = self.private or not public - Privmsg._mores[msg.nick] = (private, msgs) + self._mores[msg.nick] = (private, msgs) m = reply(msg, response, to=self.to, action=self.action, notice=self.notice, @@ -1007,7 +1008,6 @@ class Privmsg(irclib.IrcCallback): Proxy = IrcObjectProxy commandArgs = ['self', 'irc', 'msg', 'args'] # These must be class-scope, so all plugins use the same one. - _mores = ircutils.IrcDict() _disabled = DisabledCommands() def isDisabled(self, command): return self._disabled.disabled(command, self.name())