Exemple #1
0
def krn(event):
    if not event.args:
        event.reply(fmt(Kernel.cfg, skip=["otxt", "opts", "sets", "old", "res"]))
        return
    edit(Kernel.cfg, event.sets)
    Kernel.cfg.save()
    event.reply("ok")
Exemple #2
0
def cfg(event):
    c = Cfg()
    last(c)
    if not event.sets:
        return event.reply(fmt(c, skip=["username", "realname"]))
    edit(c, event.sets)
    c.save()
    event.reply("ok")
Exemple #3
0
def dpl(event):
    if len(event.args) < 2:
        event.reply("dpl <stringinurl> <item1,item2>")
        return
    setter = {"display_list": event.args[1]}
    fn, o = lastmatch("rss", {"rss": event.args[0]})
    if o:
        edit(o, setter)
        o.save()
        event.reply("ok")
Exemple #4
0
 def test_edit(self):
     d = {"mods": "rss"}
     edit(cfg, d)
     self.assertEqual(cfg.mods, "rss")