Exemple #1
0
    def _handle_recurrence(self, p_todo):
        if p_todo.has_tag('rec'):
            try:
                new_todo = advance_recurring_todo(
                    p_todo,
                    p_offset=self.completion_date,
                    p_strict=self.strict_recurrence
                )

                self.todolist.add_todo(new_todo)

                printer = PrettyPrinter()
                printer.add_filter(PrettyPrinterNumbers(self.todolist))
                self.out(printer.print_todo(new_todo))
            except NoRecurrenceException:
                self.error("Warning: todo item has an invalid recurrence pattern.")
Exemple #2
0
    def _handle_recurrence(self, p_todo):
        if p_todo.has_tag('rec'):
            try:
                if self.strict_recurrence:
                    new_todo = strict_advance_recurring_todo(p_todo,
                        self.completion_date)
                else:
                    new_todo = advance_recurring_todo(p_todo,
                        self.completion_date)

                self.todolist.add_todo(new_todo)

                printer = PrettyPrinter()
                printer.add_filter(PrettyPrinterNumbers(self.todolist))
                self.out(printer.print_todo(new_todo))
            except NoRecurrenceException:
                self.error("Warning: todo item has an invalid recurrence pattern.")
Exemple #3
0
    def pretty_print(self, p_pp_filters=None):
        """ Pretty prints the view. """
        p_pp_filters = p_pp_filters or []

        # since we're using filters, always use PrettyPrinter
        printer = PrettyPrinter()
        printer.add_filter(PrettyPrinterNumbers(self._todolist))
        printer.add_filter(PrettyPrinterColorFilter())

        for ppf in p_pp_filters:
            printer.add_filter(ppf)

        return printer.print_list(self._viewdata)
Exemple #4
0
 def _print_list(self, p_todos):
     printer = PrettyPrinter()
     printer.add_filter(PrettyPrinterNumbers(self.todolist))
     self.out(printer.print_list(p_todos))
Exemple #5
0
 def _print_list(self, p_todos):
     printer = PrettyPrinter()
     printer.add_filter(PrettyPrinterNumbers(self.todolist))
     self.out(printer.print_list(p_todos))