Ejemplo n.º 1
0
 def do_c_get(self, line):
     parser = self.parser_c_get()
     args = parser.parse_args(line)
     key = args.key
     if not key:
         key = "%"
     k = Config.select(AND(LIKE(Config.q.name, key), Config.q.system == args.system))
     fields = [(x.name, "%s (%s)" % (x.value, x.desc)) for x in k]
     if fields:
         tui.renderFields(fields)
     else:
         raise YokadiException("Configuration key %s does not exist" % line)
Ejemplo n.º 2
0
 def do_c_get(self, line):
     parser = self.parser_c_get()
     args = parser.parse_args(line)
     key = args.key
     if not key:
         key = "%"
     k = Config.select(
         AND(LIKE(Config.q.name, key), Config.q.system == args.system))
     fields = [(x.name, "%s (%s)" % (x.value, x.desc)) for x in k]
     if fields:
         tui.renderFields(fields)
     else:
         raise YokadiException("Configuration key %s does not exist" % line)
Ejemplo n.º 3
0
 def do_c_get(self, line):
     parser = self.parser_c_get()
     args = parser.parse_args(line)
     key = args.key
     if not key:
         key = "%"
     session = db.getSession()
     k = session.query(Config).filter(Config.name.like(key)).filter_by(system=args.system).all()
     fields = [(x.name, "%s (%s)" % (x.value, x.desc)) for x in k]
     if fields:
         tui.renderFields(fields)
     else:
         raise YokadiException("Configuration key %s does not exist" % line)
Ejemplo n.º 4
0
 def do_c_get(self, line):
     parser = self.parser_c_get()
     args = parser.parse_args(line)
     key = args.key
     if not key:
         key = "%"
     session = db.getSession()
     k = session.query(Config).filter(Config.name.like(key)).filter_by(system=args.system).all()
     fields = [(x.name, "%s (%s)" % (x.value, x.desc)) for x in k]
     if fields:
         tui.renderFields(fields)
     else:
         raise YokadiException("Configuration key %s does not exist" % line)
Ejemplo n.º 5
0
    def do_t_show(self, line):
        parser = self.parser_t_show()
        args = parser.parse_args(line)

        if args.decrypt:
            self.cryptoMgr.force_decrypt = True

        task = self.getTaskFromId(args.id)

        title = self.cryptoMgr.decrypt(task.title)
        description = self.cryptoMgr.decrypt(task.description)

        if args.output in ("all", "summary"):
            keywordDict = task.getKeywordDict()
            keywordArray = []
            for name, value in list(keywordDict.items()):
                txt = name
                if value:
                    txt += "=" + str(value)
                keywordArray.append(txt)
                keywordArray.sort()
            keywords = ", ".join(keywordArray)

            if task.recurrence:
                recurrence = "{} (next: {})".format(
                    task.recurrence.getFrequencyAsString(),
                    task.recurrence.getNext())
            else:
                recurrence = "None"

            fields = [
                ("Project", task.project.name),
                ("Title", title),
                ("ID", task.id),
                ("Created", task.creationDate),
                ("Due", task.dueDate),
                ("Status", task.status),
                ("Urgency", task.urgency),
                ("Recurrence", recurrence),
                ("Keywords", keywords),
            ]

            if task.status == "done":
                fields.append(("Done", task.doneDate))

            tui.renderFields(fields)

        if args.output in ("all", "description") and task.description:
            if args.output == "all":
                print()
            print(description)
Ejemplo n.º 6
0
    def do_t_show(self, line):
        parser = self.parser_t_show()
        args = parser.parse_args(line)

        task = self.getTaskFromId(args.id)

        if args.output in ("all", "summary"):
            keywordDict = task.getKeywordDict()
            keywordArray = []
            for name, value in list(keywordDict.items()):
                txt = name
                if value:
                    txt += "=" + str(value)
                keywordArray.append(txt)
                keywordArray.sort()
            keywords = ", ".join(keywordArray)

            if task.recurrence:
                recurrence = "{} (next: {})".format(
                    task.recurrence.getFrequencyAsString(),
                    task.recurrence.getNext()
                )
            else:
                recurrence = "None"

            fields = [
                ("Project", task.project.name),
                ("Title", task.title),
                ("ID", task.id),
                ("Created", task.creationDate),
                ("Due", task.dueDate),
                ("Status", task.status),
                ("Urgency", task.urgency),
                ("Recurrence", recurrence),
                ("Keywords", keywords),
            ]

            if task.status == "done":
                fields.append(("Done", task.doneDate))

            tui.renderFields(fields)

        if args.output in ("all", "description") and task.description:
            if args.output == "all":
                print()
            print(task.description)
Ejemplo n.º 7
0
    def do_t_show(self, line):
        parser = self.parser_t_show()
        args = parser.parse_args(line)

        if args.decrypt:
            self.cryptoMgr.force_decrypt = True

        task = self.getTaskFromId(args.id)

        title = self.cryptoMgr.decrypt(task.title)
        description = self.cryptoMgr.decrypt(task.description)

        if args.output in ("all", "summary"):
            keywordDict = task.getKeywordDict()
            keywordArray = []
            for name, value in list(keywordDict.items()):
                txt = name
                if value:
                    txt += "=" + str(value)
                keywordArray.append(txt)
                keywordArray.sort()
            keywords = ", ".join(keywordArray)
            fields = [
                ("Project", task.project.name),
                ("Title", title),
                ("ID", task.id),
                ("Created", task.creationDate),
                ("Due", task.dueDate),
                ("Status", task.status),
                ("Urgency", task.urgency),
                ("Recurrence", task.recurrence),
                ("Keywords", keywords),
                ]

            if task.status == "done":
                fields.append(("Done", task.doneDate))

            tui.renderFields(fields)

        if args.output in ("all", "description") and task.description:
            if args.output == "all":
                print()
            print(description)