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
5a7aeb10
Commit
5a7aeb10
authored
Nov 01, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assign tasks with no priority to lowest priority for sake of sorting.
parent
61270ddc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
4 deletions
+22
-4
test/SorterTest.py
test/SorterTest.py
+14
-3
test/data/SorterTest12-result.txt
test/data/SorterTest12-result.txt
+3
-0
test/data/SorterTest12.txt
test/data/SorterTest12.txt
+3
-0
topydo/lib/Sorter.py
topydo/lib/Sorter.py
+2
-1
No files found.
test/SorterTest.py
View file @
5a7aeb10
...
@@ -144,3 +144,14 @@ class SorterTest(unittest.TestCase):
...
@@ -144,3 +144,14 @@ class SorterTest(unittest.TestCase):
self
.
assertEquals
(
str
(
view
),
todolist_to_string
(
result
))
self
.
assertEquals
(
str
(
view
),
todolist_to_string
(
result
))
def
test_sort16
(
self
):
"""
Check sort of low priority tasks (D or lower) with non-priority tasks.
"""
sorter
=
Sorter
.
Sorter
(
'desc:importance,desc:prio'
)
todolist
=
load_file_to_todolist
(
'data/SorterTest12.txt'
)
view
=
todolist
.
view
(
sorter
,
[])
result
=
load_file
(
'data/SorterTest12-result.txt'
)
self
.
assertEquals
(
str
(
view
),
todolist_to_string
(
result
))
test/data/SorterTest12-result.txt
0 → 100644
View file @
5a7aeb10
(B) Foo
(D) Bar
Baz
test/data/SorterTest12.txt
0 → 100644
View file @
5a7aeb10
(B) Foo
Baz
(D) Bar
topydo/lib/Sorter.py
View file @
5a7aeb10
...
@@ -34,7 +34,8 @@ def get_field_function(p_field):
...
@@ -34,7 +34,8 @@ def get_field_function(p_field):
result
=
lambda
a
:
a
result
=
lambda
a
:
a
if
is_priority_field
(
p_field
):
if
is_priority_field
(
p_field
):
result
=
lambda
a
:
a
.
priority
()
# assign dummy priority when a todo has no priority
result
=
lambda
a
:
a
.
priority
()
or
'ZZ'
elif
p_field
==
'creationdate'
or
p_field
==
'creation'
:
elif
p_field
==
'creationdate'
or
p_field
==
'creation'
:
# when a task has no creation date, push it to the end by assigning it
# when a task has no creation date, push it to the end by assigning it
# the maximum possible date.
# the maximum possible date.
...
...
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