Commit 014a3cc3 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Add method to add Todo objects to TodoList.

parent 220197c4
......@@ -98,13 +98,17 @@ class TodoList(object):
if re.search(r'\S', p_src):
number = len(self._todos) + 1
todo = Todo.Todo(p_src, number)
self._todos.append(todo)
self._maintain_dep_graph(todo)
self._update_parent_cache()
self.add_todo(todo)
return todo
def add_todo(self, p_todo):
""" Add an Todo object to the list. """
self._todos.append(p_todo)
self._maintain_dep_graph(p_todo)
self._update_parent_cache()
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