def execute_specific(self, p_todo): """ Actions specific to this command. """ self._handle_recurrence(p_todo) self.execute_specific_core(p_todo) printer = PrettyPrinter() self.out(self.prefix() + printer.print_todo(p_todo))
def execute_specific(self, p_todo): """ Actions specific to this command. """ self._handle_recurrence(p_todo) self.execute_specific_core(p_todo) printer = PrettyPrinter() self.out(self.prefix() + printer.print_todo(p_todo))
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.")
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.")