3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

core: consistently call die() with irc as a keyword argument

This commit is contained in:
James Lu 2017-07-12 21:42:50 -07:00
parent b8a254167c
commit 22e6992770
2 changed files with 3 additions and 3 deletions

View File

@ -38,7 +38,7 @@ def _kill_plugins(irc=None):
if hasattr(plugin, 'die'): if hasattr(plugin, 'die'):
log.debug('coremods.control: Running die() on plugin %s due to shutdown.', name) log.debug('coremods.control: Running die() on plugin %s due to shutdown.', name)
try: try:
plugin.die(irc) plugin.die(irc=irc)
except: # But don't allow it to crash the server. except: # But don't allow it to crash the server.
log.exception('coremods.control: Error occurred in die() of plugin %s, skipping...', name) log.exception('coremods.control: Error occurred in die() of plugin %s, skipping...', name)
@ -59,7 +59,7 @@ def _shutdown(irc=None):
# HACK: run the _kill_plugins trigger with the current IRC object. XXX: We should really consider removing this # HACK: run the _kill_plugins trigger with the current IRC object. XXX: We should really consider removing this
# argument, since no plugins actually use it to do anything. # argument, since no plugins actually use it to do anything.
atexit.unregister(_kill_plugins) atexit.unregister(_kill_plugins)
_kill_plugins(irc) _kill_plugins(irc=irc)
# Remove our main PyLink bot as well. # Remove our main PyLink bot as well.
utils.unregisterService('pylink') utils.unregisterService('pylink')

View File

@ -67,7 +67,7 @@ def shutdown(irc, source, args):
log.info('(%s) SHUTDOWN requested by "%s!%s@%s", exiting...', irc.name, u.nick, log.info('(%s) SHUTDOWN requested by "%s!%s@%s", exiting...', irc.name, u.nick,
u.ident, u.host) u.ident, u.host)
control._shutdown(irc) control._shutdown(irc=irc)
@utils.add_cmd @utils.add_cmd
def load(irc, source, args): def load(irc, source, args):