コード例 #1
0
ファイル: DepCommand.py プロジェクト: rameshg87/topydo
    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)
コード例 #2
0
ファイル: DepCommand.py プロジェクト: netimen/topydo
    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)
コード例 #3
0
ファイル: ListCommand.py プロジェクト: rameshg87/topydo
    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))
コード例 #4
0
ファイル: ListCommand.py プロジェクト: netimen/topydo
    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))