コード例 #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)
コード例 #2
0
ファイル: core.py プロジェクト: melmothx/jsonbot
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)
コード例 #3
0
ファイル: core.py プロジェクト: NURDspace/jsonbot
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)
コード例 #4
0
ファイル: core.py プロジェクト: melmothx/jsonbot
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)
コード例 #5
0
ファイル: core.py プロジェクト: 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)
コード例 #6
0
ファイル: core.py プロジェクト: Petraea/jsonbot
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)
コード例 #7
0
ファイル: admin.py プロジェクト: melmothx/jsonbot
def handle_adminstop(bot, ievent):
    if bot.isgae: ievent.reply("this command doesn't work on the GAE") ; return
    mainhandler.put(0, globalshutdown)
コード例 #8
0
ファイル: admin.py プロジェクト: Lujeni/old-projects
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")
コード例 #9
0
ファイル: admin.py プロジェクト: melmothx/jsonbot
def handle_adminstop(bot, ievent):
    if bot.isgae:
        ievent.reply("this command doesn't work on the GAE")
        return
    mainhandler.put(0, globalshutdown)
コード例 #10
0
ファイル: admin.py プロジェクト: NURDspace/jsonbot
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)