Commit 28532694 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Print todo text when removing it.

parent e6d6cbe7
# Topydo - A todo.txt client written in Python.
# Copyright (C) 2014 Bram Schoenmakers <me@bramschoenmakers.nl>
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
......@@ -33,7 +33,7 @@ class DeleteCommandTest(CommandTest.CommandTest):
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.todolist.todo(1).source(), "Bar")
self.assertEquals(self.output, "Todo 1 removed.\n")
self.assertEquals(self.output, " 1 Foo id:1\nRemoved.\n")
self.assertEquals(self.errors, "")
def test_del2(self):
......@@ -42,7 +42,7 @@ class DeleteCommandTest(CommandTest.CommandTest):
self.assertTrue(self.todolist.is_dirty())
self.assertEquals(self.todolist.todo(1).source(), "Foo")
self.assertEquals(self.output, "Todo 2 removed.\n")
self.assertEquals(self.output, " 2 Bar p:1\nRemoved.\n")
self.assertEquals(self.errors, "")
def test_del3(self):
......
# Topydo - A todo.txt client written in Python.
# Copyright (C) 2014 Bram Schoenmakers <me@bramschoenmakers.nl>
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from Command import *
from PrettyPrinter import pretty_print
from TodoList import InvalidTodoException
from Utils import convert_todo_number, InvalidTodoNumberException
......@@ -40,8 +41,9 @@ class DeleteCommand(Command):
if not self.number:
self.error(self.usage())
elif self.todo:
self.out(pretty_print(self.todo, [self.todolist.pp_number()]))
self.todolist.delete(self.todo)
self.out("Todo %d removed." % self.number)
self.out("Removed.")
else:
self.error("Invalid todo number given.")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment