mirror of
https://github.com/progval/Limnoria.git
synced 2025-04-27 05:21:09 -05:00
Changed many dictionaries to the more appropriate ircutils.IrcDict.
This commit is contained in:
parent
5a8f0ce7fa
commit
6aa1e8a7ed
@ -44,12 +44,13 @@ import debug
|
|||||||
import world
|
import world
|
||||||
import irclib
|
import irclib
|
||||||
import ircmsgs
|
import ircmsgs
|
||||||
|
import ircutils
|
||||||
|
|
||||||
###
|
###
|
||||||
# Logger: Handles logging of IRC channels to files.
|
# Logger: Handles logging of IRC channels to files.
|
||||||
###
|
###
|
||||||
class ChannelLogger(irclib.IrcCallback):
|
class ChannelLogger(irclib.IrcCallback):
|
||||||
logs = {}
|
logs = ircutils.IrcDict()
|
||||||
actionre = re.compile('\x01ACTION (.*)\x01')
|
actionre = re.compile('\x01ACTION (.*)\x01')
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.laststate = None
|
self.laststate = None
|
||||||
@ -63,7 +64,7 @@ class ChannelLogger(irclib.IrcCallback):
|
|||||||
def reset(self):
|
def reset(self):
|
||||||
for log in self.logs.itervalues():
|
for log in self.logs.itervalues():
|
||||||
log.close()
|
log.close()
|
||||||
self.logs = {}
|
self.logs = ircutils.IrcDict()
|
||||||
|
|
||||||
def flush(self):
|
def flush(self):
|
||||||
for log in self.logs.itervalues():
|
for log in self.logs.itervalues():
|
||||||
|
@ -178,7 +178,7 @@ class Relay(callbacks.Privmsg):
|
|||||||
channels.
|
channels.
|
||||||
"""
|
"""
|
||||||
channel = privmsgs.getArgs(args)
|
channel = privmsgs.getArgs(args)
|
||||||
self.channels.add(channel)
|
self.channels.add(ircutils.toLower(channel))
|
||||||
for otherIrc in self.ircs.itervalues():
|
for otherIrc in self.ircs.itervalues():
|
||||||
if channel not in otherIrc.state.channels:
|
if channel not in otherIrc.state.channels:
|
||||||
otherIrc.queueMsg(ircmsgs.join(channel))
|
otherIrc.queueMsg(ircmsgs.join(channel))
|
||||||
@ -193,7 +193,7 @@ class Relay(callbacks.Privmsg):
|
|||||||
channel.
|
channel.
|
||||||
"""
|
"""
|
||||||
channel = privmsgs.getArgs(args)
|
channel = privmsgs.getArgs(args)
|
||||||
self.channels.remove(channel)
|
self.channels.remove(ircutils.toLower(channel))
|
||||||
for otherIrc in self.ircs.itervalues():
|
for otherIrc in self.ircs.itervalues():
|
||||||
if channel in otherIrc.state.channels:
|
if channel in otherIrc.state.channels:
|
||||||
otherIrc.queueMsg(ircmsgs.part(channel))
|
otherIrc.queueMsg(ircmsgs.part(channel))
|
||||||
|
@ -252,7 +252,7 @@ class UsersDictionary(object):
|
|||||||
fd.close()
|
fd.close()
|
||||||
self.dict = eval(normalize(s))
|
self.dict = eval(normalize(s))
|
||||||
self.cache = {} # hostmasks to nicks.
|
self.cache = {} # hostmasks to nicks.
|
||||||
self.revcache = {} # nicks to hostmasks.
|
self.revcache = ircutils.IrcDict() # nicks to hostmasks.
|
||||||
|
|
||||||
def resetCache(self, s):
|
def resetCache(self, s):
|
||||||
if s in self.cache:
|
if s in self.cache:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user