From 1cdf16f5c9ef63c3a75d910a1c0852a4a01e8e5f Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 2 Mar 2018 20:01:19 -0800 Subject: [PATCH] various: migrate utils.loadPlugin, getProtocolModule, resetModuleDirs calls to snake-case (#523) --- coremods/control.py | 4 ++-- coremods/corecommands.py | 2 +- launcher.py | 6 +++--- plugins/networks.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/coremods/control.py b/coremods/control.py index 8f99052..c9a8242 100644 --- a/coremods/control.py +++ b/coremods/control.py @@ -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) diff --git a/coremods/corecommands.py b/coremods/corecommands.py index 6be0f9e..17858d7 100644 --- a/coremods/corecommands.py +++ b/coremods/corecommands.py @@ -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) diff --git a/launcher.py b/launcher.py index 597cc37..6293f03 100644 --- a/launcher.py +++ b/launcher.py @@ -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) diff --git a/plugins/networks.py b/plugins/networks.py index ea26ded..2130156 100644 --- a/plugins/networks.py +++ b/plugins/networks.py @@ -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)