예제 #1
0
파일: plug.py 프로젝트: code2u/jsb
def handle_plugenable(bot, event):
    """ arguments" <plugname> - enable a plugin. """
    if not event.rest: event.missing("<plugname>") ; return
    mod = bot.plugs.getmodule(event.rest)
    if not mod: event.reply("can't find module for %s" % event.rest) ; return
    event.reply("reloading and enabling %s" % mod)
    plugenable(mod)
    bot.enable(mod)
    bot.plugs.reload(mod, force=True)
    event.done()
예제 #2
0
파일: plug.py 프로젝트: NURDspace/jsonbot
def handle_plugenable(bot, event):
    """ arguments" <plugname> - enable a plugin. """
    if not event.rest: event.missing("<plugname>") ; return
    if "." in event.rest: mod = event.rest
    else: mod = bot.plugs.getmodule(event.rest)
    if not mod: event.reply("can't find module for %s" % event.rest) ; return
    event.reply("reloading and enabling %s" % mod)
    plugenable(mod)
    bot.do_enable(mod)
    bot.plugs.reload(mod, force=True, showerror=True)
    update_mod(mod)
    event.done()
예제 #3
0
def handle_plugenable(bot, event):
    """ arguments" <plugname> - enable a plugin. """
    if not event.rest:
        event.missing("<plugname>")
        return
    if "." in event.rest: mod = event.rest
    else: mod = bot.plugs.getmodule(event.rest)
    if not mod:
        event.reply("can't find module for %s" % event.rest)
        return
    event.reply("reloading and enabling %s" % mod)
    plugenable(mod)
    bot.do_enable(mod)
    bot.plugs.reload(mod, force=True, showerror=True)
    update_mod(mod)
    event.done()