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
6a474492
Commit
6a474492
authored
Nov 24, 2016
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sort case insensitively on todo texts
parent
69715c07
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
test/data/SorterTest1-result.txt
test/data/SorterTest1-result.txt
+1
-1
test/data/SorterTest1.txt
test/data/SorterTest1.txt
+1
-1
test/test_sort_command.py
test/test_sort_command.py
+2
-2
topydo/lib/Sorter.py
topydo/lib/Sorter.py
+1
-1
No files found.
test/data/SorterTest1-result.txt
View file @
6a474492
F
irst
f
irst
(A) Foo
(A) Foo
2014-06-14 Last
2014-06-14 Last
test/data/SorterTest1.txt
View file @
6a474492
(A) Foo
(A) Foo
2014-06-14 Last
2014-06-14 Last
F
irst
f
irst
test/test_sort_command.py
View file @
6a474492
...
@@ -33,14 +33,14 @@ class SortCommandTest(CommandTest):
...
@@ -33,14 +33,14 @@ class SortCommandTest(CommandTest):
command
.
execute
()
command
.
execute
()
self
.
assertEqual
(
self
.
todolist
.
print_todos
(),
self
.
assertEqual
(
self
.
todolist
.
print_todos
(),
"
F
irst
\
n
(A) Foo
\
n
2014-06-14 Last"
)
"
f
irst
\
n
(A) Foo
\
n
2014-06-14 Last"
)
def
test_sort2
(
self
):
def
test_sort2
(
self
):
command
=
SortCommand
([],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
=
SortCommand
([],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
.
execute
()
command
.
execute
()
self
.
assertEqual
(
self
.
todolist
.
print_todos
(),
self
.
assertEqual
(
self
.
todolist
.
print_todos
(),
"(A) Foo
\
n
2014-06-14 Last
\
n
F
irst"
)
"(A) Foo
\
n
2014-06-14 Last
\
n
f
irst"
)
def
test_sort3
(
self
):
def
test_sort3
(
self
):
""" Check that order does not influence the UID of a todo. """
""" Check that order does not influence the UID of a todo. """
...
...
topydo/lib/Sorter.py
View file @
6a474492
...
@@ -57,7 +57,7 @@ def get_field_function(p_field):
...
@@ -57,7 +57,7 @@ def get_field_function(p_field):
elif
p_field
==
'project'
or
p_field
==
'projects'
:
elif
p_field
==
'project'
or
p_field
==
'projects'
:
result
=
lambda
a
:
sorted
([
c
.
lower
()
for
c
in
a
.
projects
()])
result
=
lambda
a
:
sorted
([
c
.
lower
()
for
c
in
a
.
projects
()])
elif
p_field
==
'text'
:
elif
p_field
==
'text'
:
result
=
lambda
a
:
a
.
text
()
result
=
lambda
a
:
a
.
text
()
.
lower
()
else
:
else
:
# try to find the corresponding tag
# try to find the corresponding tag
# when a tag is not present, push it to the end of the list by giving
# when a tag is not present, push it to the end of the list by giving
...
...
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