コード例 #1
0
def shutdown(irc=None):
    """Shuts down the Pylink daemon."""
    if world.shutting_down.is_set(
    ):  # We froze on shutdown last time, so immediately abort.
        _print_remaining_threads()
        raise KeyboardInterrupt("Forcing shutdown.")

    world.shutting_down.set()

    # 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=irc)

    # Remove our main PyLink bot as well.
    utils.unregister_service('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()
コード例 #2
0
def die(irc=None):
    utils.unregister_service('games')
コード例 #3
0
ファイル: antispam.py プロジェクト: SylvainGault/PyLink
def die(irc=None):
    utils.unregister_service("antispam")
コード例 #4
0
def die(irc=None):
    """Saves the Automode database and quit."""
    datastore.die()
    permissions.remove_default_permissions(default_permissions)
    utils.unregister_service('automode')