Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
topydo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
topydo
Commits
28532694
Commit
28532694
authored
Nov 01, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print todo text when removing it.
parent
e6d6cbe7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
test/DeleteCommandTest.py
test/DeleteCommandTest.py
+5
-5
topydo/lib/DeleteCommand.py
topydo/lib/DeleteCommand.py
+6
-4
No files found.
test/DeleteCommandTest.py
View file @
28532694
...
...
@@ -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 r
emoved.
\
n
"
)
self
.
assertEquals
(
self
.
output
,
"
1 Foo id:1
\
n
R
emoved.
\
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 r
emoved.
\
n
"
)
self
.
assertEquals
(
self
.
output
,
"
2 Bar p:1
\
n
R
emoved.
\
n
"
)
self
.
assertEquals
(
self
.
errors
,
""
)
def
test_del3
(
self
):
...
...
topydo/lib/DeleteCommand.py
View file @
28532694
...
...
@@ -15,6 +15,7 @@
# 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."
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment