Moved _mores to IrcObjectProxy, where it more rightfully belongs.

This commit is contained in:
Jeremy Fincher 2005-02-07 06:28:52 +00:00
parent 808db8153b
commit 70d1b1d5d0
3 changed files with 7 additions and 7 deletions

View File

@ -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'))

View File

@ -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=''):

View File

@ -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())