3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +01:00

commands: support rehashing channel loggers

This commit is contained in:
James Lu 2016-01-23 13:41:47 -08:00
parent 2503bd3ee5
commit cf1de08457

View File

@ -197,6 +197,13 @@ def rehash(irc, source, args):
ircobj.conf = new_conf ircobj.conf = new_conf
ircobj.serverdata = new_conf['servers'][network] ircobj.serverdata = new_conf['servers'][network]
ircobj.botdata = new_conf['bot'] ircobj.botdata = new_conf['bot']
# Clear the IRC object's channel logger and replace it with a
# new one by re-running logSetup().
log.removeHandler(ircobj.loghandler)
ircobj.loghandler = None
ircobj.logSetup()
for network, sdata in new_conf['servers'].items(): for network, sdata in new_conf['servers'].items():
# New server was added. Connect them if not already connected. # New server was added. Connect them if not already connected.
if network not in world.networkobjects: if network not in world.networkobjects: