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
9e1bdfa6
Commit
9e1bdfa6
authored
Feb 11, 2016
by
MinchinWeb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow iteration of TodoList items.
parent
473204aa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
test/test_todo_list.py
test/test_todo_list.py
+14
-0
topydo/lib/PrettyPrinterFilter.py
topydo/lib/PrettyPrinterFilter.py
+0
-1
topydo/lib/TodoListBase.py
topydo/lib/TodoListBase.py
+6
-0
No files found.
test/test_todo_list.py
View file @
9e1bdfa6
...
...
@@ -234,6 +234,19 @@ class TodoListTester(TopydoTest):
self.assertNotEqual(self.todolist.number(todo), '
t5c
')
def test_iteration(self):
""" Confirms that the iternation method is working. """
results = ["(C) Foo @Context2 Not@Context +Project1 Not+Project",
"(D) Bar @Context1 +Project2",
"(C) Baz @Context1 +Project1 key:value",
"(C) Drink beer @ home",
"(C) 13 + 29 = 42"]
i = 0
for todo in self.todolist:
self.assertEqual(todo.src, results[i])
i += 1
class TodoListDependencyTester(TopydoTest):
def setUp(self):
...
...
@@ -402,6 +415,7 @@ class TodoListDependencyTester(TopydoTest):
self.assertTrue(self.todolist.dirty)
self.assertTrue(self.todolist.todo_by_dep_id('
99
'))
class TodoListCleanDependencyTester(TopydoTest):
"""
Tests for cleaning up the graph:
...
...
topydo/lib/PrettyPrinterFilter.py
View file @
9e1bdfa6
...
...
@@ -29,4 +29,3 @@ class PrettyPrinterFilter(object):
Applies a filter to p_todo_str and returns a modified version of it.
"""
raise
NotImplementedError
topydo/lib/TodoListBase.py
View file @
9e1bdfa6
...
...
@@ -54,6 +54,12 @@ class TodoListBase(object):
self
.
add_list
(
p_todostrings
)
self
.
dirty
=
False
def
__iter__
(
self
):
"""
Allows use of `for my_todo in todolist` constructs.
"""
return
iter
(
self
.
_todos
)
def
todo
(
self
,
p_identifier
):
"""
The _todos list has the same order as in the backend store (usually
...
...
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