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
e93393b9
Commit
e93393b9
authored
Nov 19, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When new priority is the same, don't print it has changed.
parent
958398e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
test/PriorityCommandTest.py
test/PriorityCommandTest.py
+10
-3
topydo/lib/PriorityCommand.py
topydo/lib/PriorityCommand.py
+5
-5
No files found.
test/PriorityCommandTest.py
View file @
e93393b9
# 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/>.
...
...
@@ -51,6 +51,13 @@ class PriorityCommandTest(CommandTest.CommandTest):
self
.
assertEquals
(
self
.
output
,
"Priority changed from A to B
\
n
(B) Foo
\
n
"
)
self
.
assertEquals
(
self
.
errors
,
""
)
def
test_set_prio4
(
self
):
command
=
PriorityCommand
.
PriorityCommand
([
"1"
,
"A"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
.
execute
()
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEquals
(
self
.
output
,
"(A) Foo
\
n
"
)
self
.
assertEquals
(
self
.
errors
,
""
)
def
test_invalid1
(
self
):
command
=
PriorityCommand
.
PriorityCommand
([
"99"
,
"A"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
...
...
topydo/lib/PriorityCommand.py
View file @
e93393b9
# 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/>.
...
...
@@ -41,9 +41,9 @@ class PriorityCommand(Command):
old_priority
=
todo
.
priority
()
self
.
todolist
.
set_priority
(
todo
,
priority
)
if
old_priority
and
priority
:
if
old_priority
and
priority
and
old_priority
!=
priority
:
self
.
out
(
"Priority changed from %s to %s"
%
(
old_priority
,
priority
))
el
se
:
el
if
not
old_priority
:
self
.
out
(
"Priority set to %s."
%
priority
)
self
.
out
(
pretty_print
(
todo
))
...
...
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