Exemple #1
0
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()
Exemple #2
0
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')
Exemple #3
0
def die(irc=None):
    """Saves the Automode database and quit."""
    datastore.die()
    permissions.removeDefaultPermissions(default_permissions)
    utils.unregisterService('automode')
Exemple #4
0
def die(irc):
    utils.unregisterService('welcome')
Exemple #5
0
def die(irc):
    utils.unregisterService('games')
Exemple #6
0
def die(irc):
    permissions.removeDefaultPermissions(default_permissions)
    utils.unregisterService("quote")
Exemple #7
0
def die(irc):
    utils.unregisterService('ctcp')