Commit ada47bc3 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Return instance of todo that has been added.

Returns None when no todo item was added.
parent 814b3179
......@@ -94,6 +94,7 @@ class TodoList(object):
Then there will be an edge 1 --> 2 with ID 4.
"""
todo = None
if re.search(r'\S', p_src):
number = len(self._todos) + 1
todo = Todo.Todo(p_src, number)
......@@ -101,6 +102,8 @@ class TodoList(object):
self._maintain_dep_graph(todo)
return todo
def delete(self, p_number):
""" Deletes a todo item from the list. """
todo = self.todo(p_number)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment