3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-02-02 23:54:08 +01:00

various: migrate utils.loadPlugin, getProtocolModule, resetModuleDirs calls to snake-case (#523)

This commit is contained in:
James Lu 2018-03-02 20:01:19 -08:00
parent bea2ea8ebd
commit 1cdf16f5c9
4 changed files with 7 additions and 7 deletions

View File

@ -125,13 +125,13 @@ def rehash():
ircobj.log_setup()
utils.resetModuleDirs()
utils.reset_module_dirs()
for network, sdata in new_conf['servers'].items():
# Connect any new networks or disconnected networks if they aren't already.
if (network not in world.networkobjects) or (not world.networkobjects[network]._connection_thread.is_alive()):
try:
proto = utils.getProtocolModule(sdata['protocol'])
proto = utils.get_protocol_module(sdata['protocol'])
# API note: 2.0.x style of starting network connections
world.networkobjects[network] = newirc = proto.Class(network)

View File

@ -106,7 +106,7 @@ def load(irc, source, args):
return
log.info('(%s) Loading plugin %r for %s', irc.name, name, irc.get_hostmask(source))
try:
world.plugins[name] = pl = utils.loadPlugin(name)
world.plugins[name] = pl = utils.load_plugin(name)
except ImportError as e:
if str(e) == ('No module named %r' % name):
log.exception('Failed to load plugin %r: The plugin could not be found.', name)

View File

@ -143,11 +143,11 @@ def main():
# Load configured plugins
to_load = conf.conf['plugins']
utils.resetModuleDirs()
utils.reset_module_dirs()
for plugin in to_load:
try:
world.plugins[plugin] = pl = utils.loadPlugin(plugin)
world.plugins[plugin] = pl = utils.load_plugin(plugin)
except Exception as e:
log.exception('Failed to load plugin %r: %s: %s', plugin, type(e).__name__, str(e))
else:
@ -164,7 +164,7 @@ def main():
else:
# Fetch the correct protocol module.
try:
proto = utils.getProtocolModule(protoname)
proto = utils.get_protocol_module(protoname)
# Create and connect the network.
world.networkobjects[network] = irc = proto.Class(network)

View File

@ -173,7 +173,7 @@ def reloadproto(irc, source, args):
irc.error('Not enough arguments (needs 1: protocol module name)')
return
proto = utils.getProtocolModule(name)
proto = utils.get_protocol_module(name)
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)