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
f4fadceb
Commit
f4fadceb
authored
Jul 19, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Be more defensive about invalid task numbers.
parent
db5c890d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
TodoList.py
TodoList.py
+10
-2
test/TodoListTest.py
test/TodoListTest.py
+3
-0
No files found.
TodoList.py
View file @
f4fadceb
...
...
@@ -110,8 +110,10 @@ class TodoList(object):
"""
if len(p_string) > 0:
todo = self.todo(p_number)
new_text = todo.source() + '
' + p_string
todo.set_text(new_text)
if todo:
new_text = todo.source() + '
' + p_string
todo.set_text(new_text)
def projects(self):
""" Returns a set of all projects in this list. """
...
...
@@ -160,6 +162,9 @@ class TodoList(object):
from_todo = self.todo(p_number1)
to_todo = self.todo(p_number2)
if not from_todo or not to_todo:
return
dep_id = None
if from_todo.has_tag('
id
'):
dep_id = from_todo.tag_value('
id
')
...
...
@@ -174,6 +179,9 @@ class TodoList(object):
from_todo = self.todo(p_number1)
to_todo = self.todo(p_number2)
if not from_todo or not to_todo:
return
dep_id = from_todo.tag_value('
id
')
if dep_id:
...
...
test/TodoListTest.py
View file @
f4fadceb
...
...
@@ -101,6 +101,9 @@ class TodoListTester(unittest.TestCase):
self.assertEquals(self.todolist.todo(3).text(), text)
def test_append4(self):
self.todolist.append(999, '
foo
')
def test_todo(self):
count = self.todolist.count()
todo = self.todolist.todo(count+100)
...
...
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