Exemplo n.º 1
0
def handle_adminstop(bot, ievent):
    """ no arguments - stop the bot. """
    ievent.untildone = True
    if bot.ownercheck(ievent.userhost): mainhandler.put(0, globalshutdown)
    else:
        ievent.reply("you are not the owner of the bot")
        return
    ievent.done(silent=True)
Exemplo n.º 2
0
def handle_reboot(bot, ievent):
    """ reboot the bot. """
    if bot.isgae:
        ievent.reply("this command doesn't work on the GAE")
        return
    ievent.reply("rebooting")
    time.sleep(3)
    if ievent.rest == "cold": stateful = False
    else: stateful = True
    if stateful: mainhandler.put(0, reboot_stateful, bot, ievent, getfleet(), partyline)
    else:
        bot.exit()
        mainhandler.put(0, reboot)
Exemplo n.º 3
0
def handle_reboot(bot, ievent):
    """ no arguments - reboot the bot. """
    ievent.reply("rebooting")
    #time.sleep(3)
    if ievent.rest == "cold": stateful = False
    else: stateful = True
    if stateful:
        if bot.type == "tornado": 
            callback = functools.partial(reboot_stateful, bot, ievent, getfleet(), partyline)
            bot.server.io_loop.add_callback(callback)
        else: mainhandler.put(0, reboot_stateful, bot, ievent, getfleet(), partyline)
    else:
        getfleet().exit()
        mainhandler.put(0, reboot)
Exemplo n.º 4
0
def handle_reboot(bot, ievent):
    """ reboot the bot. """
    if bot.isgae:
        ievent.reply("this command doesn't work on the GAE")
        return
    ievent.reply("rebooting")
    time.sleep(3)
    if ievent.rest == "cold": stateful = False
    else: stateful = True
    if stateful:
        mainhandler.put(0, reboot_stateful, bot, ievent, getfleet(), partyline)
    else:
        bot.exit()
        mainhandler.put(0, reboot)
Exemplo n.º 5
0
Arquivo: core.py Projeto: code2u/jsb
def handle_reboot(bot, ievent):
    """ no arguments - reboot the bot. """
    if bot.isgae:
        ievent.reply("this command doesn't work on the GAE")
        return
    ievent.reply("rebooting")
    time.sleep(3)
    if ievent.rest == "cold": stateful = False
    else: stateful = True
    if stateful:
        if bot.type == "tornado": bot.ioloop.add_callback(lambda: reboot_stateful(bot, ievent, getfleet(), partyline))
        else: mainhandler.put(0, reboot_stateful, bot, ievent, getfleet(), partyline)
    else:
        getfleet().exit()
        mainhandler.put(0, reboot)
Exemplo n.º 6
0
def handle_reboot(bot, ievent):
    """ no arguments - reboot the bot. """
    ievent.reply("rebooting")
    #time.sleep(3)
    if ievent.rest == "cold": stateful = False
    else: stateful = True
    if stateful:
        if bot.type == "tornado":
            callback = functools.partial(reboot_stateful, bot, ievent,
                                         getfleet(), partyline)
            bot.server.io_loop.add_callback(callback)
        else:
            mainhandler.put(0, reboot_stateful, bot, ievent, getfleet(),
                            partyline)
    else:
        getfleet().exit()
        mainhandler.put(0, reboot)
Exemplo n.º 7
0
def handle_adminstop(bot, ievent):
    if bot.isgae: ievent.reply("this command doesn't work on the GAE") ; return
    mainhandler.put(0, globalshutdown)
Exemplo n.º 8
0
def handle_adminstop(bot, ievent):
    """ no arguments - stop the bot. """
    if bot.isgae: ievent.reply("this command doesn't work on the GAE") ; return
    if bot.ownercheck(ievent.userhost): mainhandler.put(0, globalshutdown)
    else: ievent.reply("you are not the owner of the bot")
Exemplo n.º 9
0
def handle_adminstop(bot, ievent):
    if bot.isgae:
        ievent.reply("this command doesn't work on the GAE")
        return
    mainhandler.put(0, globalshutdown)
Exemplo n.º 10
0
def handle_adminstop(bot, ievent):
    """ no arguments - stop the bot. """
    ievent.untildone = True
    if bot.ownercheck(ievent.userhost): mainhandler.put(0, globalshutdown)
    else: ievent.reply("you are not the owner of the bot") ; return
    ievent.done(silent=True)