mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-24 03:33:10 +01:00
Rename utils.getProtoModule => utils.getProtocolModule
This commit is contained in:
parent
2391918deb
commit
9a81a2ba1f
@ -199,7 +199,7 @@ def rehash(irc, source, args):
|
||||
for network, sdata in new_conf['servers'].items():
|
||||
# New server was added. Connect them if not already connected.
|
||||
if network not in world.networkobjects:
|
||||
proto = utils.getProtoModule(sdata['protocol'])
|
||||
proto = utils.getProtocolModule(sdata['protocol'])
|
||||
world.networkobjects[network] = classes.Irc(network, proto, new_conf)
|
||||
irc.reply("Done.")
|
||||
|
||||
|
12
pylink
12
pylink
@ -39,10 +39,18 @@ if __name__ == '__main__':
|
||||
log.debug('Calling main() function of plugin %r', pl)
|
||||
pl.main()
|
||||
|
||||
for network in conf.conf['servers']:
|
||||
proto = utils.getProtoModule(conf.conf['servers'][network]['protocol'])
|
||||
# Initialize all the networks one by one
|
||||
for network, sdata in conf.conf['servers'].items():
|
||||
|
||||
protoname = sdata['protocol']
|
||||
|
||||
# Fetch the correct protocol module
|
||||
proto = utils.getProtocolModule(protoname)
|
||||
world.networkobjects[network] = irc = classes.Irc(network, proto, conf.conf)
|
||||
|
||||
# Call coreplugin's initialization method
|
||||
log.debug('Calling main() function of coreplugin on network %s', irc.name)
|
||||
coreplugin.main(irc)
|
||||
|
||||
world.started.set()
|
||||
log.info("loaded plugins: %s", world.plugins)
|
||||
|
2
utils.py
2
utils.py
@ -519,7 +519,7 @@ def loadModuleFromFolder(name, folder):
|
||||
m = importlib.machinery.SourceFileLoader(name, fullpath).load_module()
|
||||
return m
|
||||
|
||||
def getProtoModule(protoname):
|
||||
def getProtocolModule(protoname):
|
||||
"""Imports and returns the protocol module requested."""
|
||||
return loadModuleFromFolder(protoname, world.protocols_folder)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user