mirror of
https://github.com/jlu5/PyLink.git
synced 2025-10-14 15:37:31 +02:00
networks: reload shared modules used by protocol modules too
This commit is contained in:
parent
8a096e537c
commit
5838d88404
@ -3,7 +3,8 @@ import importlib
|
|||||||
import types
|
import types
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
from pylinkirc import utils, world, conf, classes
|
import pylinkirc
|
||||||
|
from pylinkirc import utils, world
|
||||||
from pylinkirc.log import log
|
from pylinkirc.log import log
|
||||||
from pylinkirc.coremods import control, permissions
|
from pylinkirc.coremods import control, permissions
|
||||||
|
|
||||||
@ -177,7 +178,17 @@ def reloadproto(irc, source, args):
|
|||||||
irc.error('Not enough arguments (needs 1: protocol module name)')
|
irc.error('Not enough arguments (needs 1: protocol module name)')
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Reload the dependency libraries first
|
||||||
|
importlib.reload(pylinkirc.classes)
|
||||||
|
log.debug('networks.reloadproto: reloading %s', pylinkirc.classes)
|
||||||
|
|
||||||
|
for common_name in pylinkirc.protocols.common_modules:
|
||||||
|
module = utils._get_protocol_module(common_name)
|
||||||
|
log.debug('networks.reloadproto: reloading %s', module)
|
||||||
|
importlib.reload(module)
|
||||||
|
|
||||||
proto = utils._get_protocol_module(name)
|
proto = utils._get_protocol_module(name)
|
||||||
|
log.debug('networks.reloadproto: reloading %s', proto)
|
||||||
importlib.reload(proto)
|
importlib.reload(proto)
|
||||||
|
|
||||||
irc.reply("Done. You will have to manually disconnect and reconnect any network using the %r module for changes to apply." % name)
|
irc.reply("Done. You will have to manually disconnect and reconnect any network using the %r module for changes to apply." % name)
|
||||||
|
@ -1 +1,2 @@
|
|||||||
# Stub so that pylinkirc.protocols is a module
|
# Abstract modules containing shared protocol code; modules higher in the hierarchy go first
|
||||||
|
common_modules = ['ircs2s_common', 'ts6_common']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user