Esempio n. 1
0
    def __init__(self, p_args, p_todolist, #pragma: no branch
                 p_out=lambda a: None,
                 p_err=lambda a: None,
                 p_prompt=lambda a: None):
        super().__init__(
            p_args, p_todolist, p_out, p_err, p_prompt)

        try:
            self.subsubcommand = self.argument(0)
        except InvalidCommandArgument:
            self.subsubcommand = None

        self.printer = pretty_printer_factory(self.todolist)
Esempio n. 2
0
    def __init__(self,
                 p_args,
                 p_todolist,
                 p_out=lambda a: None,
                 p_err=lambda a: None,
                 p_prompt=lambda a: None):
        super(DepCommand, self).__init__(p_args, p_todolist, p_out, p_err,
                                         p_prompt)

        try:
            self.subsubcommand = self.argument(0)
        except InvalidCommandArgument:
            self.subsubcommand = None

        self.printer = pretty_printer_factory(self.todolist)
Esempio n. 3
0
    def _print(self):
        """
        Prints the todos in the right format.

        Defaults to normal text output (with possible colors and other pretty
        printing). If a format was specified on the commandline, this format is
        sent to the output.
        """
        if self.printer is None:
            # create a standard printer with some filters
            indent = config().list_indent()
            final_format = ' ' * indent + self.format

            filters = []
            filters.append(PrettyPrinterFormatFilter(self.todolist, final_format))

            self.printer = pretty_printer_factory(self.todolist, filters)

        self.out(self.printer.print_list(self._view().todos))
Esempio n. 4
0
    def _print(self):
        """
        Prints the todos in the right format.

        Defaults to normal text output (with possible colors and other pretty
        printing. If a format was specified on the commandline, this format is
        sent to the output.
        """

        if self.printer == None:
            # create a standard printer with some filters
            indent = config().list_indent()
            hidden_tags = config().hidden_tags()

            filters = []
            filters.append(PrettyPrinterIndentFilter(indent))
            filters.append(PrettyPrinterHideTagFilter(hidden_tags))

            self.printer = pretty_printer_factory(self.todolist, filters)

        self.out(self.printer.print_list(self._view().todos))