def _shutdown(irc=None): """Shuts down the Pylink daemon.""" global tried_shutdown if tried_shutdown: # We froze on shutdown last time, so immediately abort. _print_remaining_threads() raise KeyboardInterrupt("Forcing shutdown.") tried_shutdown = True # 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. atexit.unregister(_kill_plugins) _kill_plugins(irc) # Remove our main PyLink bot as well. utils.unregisterService('pylink') for ircobj in world.networkobjects.copy().values(): # Disconnect all our networks. remove_network(ircobj) log.info( "Waiting for remaining threads to stop; this may take a few seconds. If PyLink freezes " "at this stage, press Ctrl-C to force a shutdown.") _print_remaining_threads()
def die(sourceirc): """Saves the Automode database and quit.""" exportDB() # Kill the scheduling for exports. global exportdb_timer if exportdb_timer: log.debug("Automode: cancelling exportDB timer thread %s due to die()", threading.get_ident()) exportdb_timer.cancel() utils.unregisterService('automode')
def die(irc=None): """Saves the Automode database and quit.""" datastore.die() permissions.removeDefaultPermissions(default_permissions) utils.unregisterService('automode')
def die(irc): utils.unregisterService('welcome')
def die(irc): utils.unregisterService('games')
def die(irc): permissions.removeDefaultPermissions(default_permissions) utils.unregisterService("quote")
def die(irc): utils.unregisterService('ctcp')