Commit ae6ac48e authored by Seblu's avatar Seblu
Browse files

New rights display. Fix too many filter. Disable TQL indexing

parent 6b4f7c29
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ class Command_rights(TqlCommand):
        self.tql_filter += "&a&r=cli"
        self.remove_option("--direct")
        self.remove_option("--quiet")
        self.remove_option("--index")

    def __call__(self, argv):
        # Parse argline
@@ -28,14 +29,11 @@ class Command_rights(TqlCommand):
            tql = "a=%s"%self.cli.settings["login"]
        else:
            tql = "".join(self.args)
            # update tql if mode
            if not self.options.raw:
                tql += "&a"
        # ask server
        al = self.rpccall("rights", tql, _direct=True, _status=False)
        # display answer
        for (a, rl) in al.items():
            self.printer.out("rights of %s%s%s"%(self.tdc("a"), a, color["reset"]))
            self.printer.out("%sa:%s%s%s"%(self.tdtc("a"), self.tdc("a"), a, color["reset"]))
            for i,r in enumerate(rl):
                tags = " ".join([ "%s%s:%s%s"%(self.tdtc(t), t, self.tdc(t), v) for (t,v) in r.items() ])
                self.printer.out("[%s] %s%s"%(i,tags, color["reset"]))