Exemplo n.º 1
0
Arquivo: plug.py Projeto: 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()
Exemplo n.º 2
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()
Exemplo n.º 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()