Commit fd52d3fc authored by Bram Schoenmakers's avatar Bram Schoenmakers

Remove some leftover attribute[number]

parent 756616db
...@@ -49,9 +49,9 @@ class AddCommand(Command.Command): ...@@ -49,9 +49,9 @@ class AddCommand(Command.Command):
continue continue
if p_tag == 'after': if p_tag == 'after':
self.todolist.add_dependency(self.todo.attributes['number'], value) self.todolist.add_dependency(self.todolist.number(self.todo), value)
elif p_tag == 'before' or p_tag == 'partof': elif p_tag == 'before' or p_tag == 'partof':
self.todolist.add_dependency(value, self.todo.attributes['number']) self.todolist.add_dependency(value, self.todolist.number(self.todo))
self.todo.remove_tag(p_tag, raw_value) self.todo.remove_tag(p_tag, raw_value)
......
...@@ -9,4 +9,4 @@ class ArchiveCommand(Command.Command): ...@@ -9,4 +9,4 @@ class ArchiveCommand(Command.Command):
def execute(self): def execute(self):
for todo in [t for t in self.todolist.todos() if t.is_completed()]: for todo in [t for t in self.todolist.todos() if t.is_completed()]:
self.archive.add_todo(todo) self.archive.add_todo(todo)
self.todolist.delete(todo.attributes['number']) self.todolist.delete(self.todolist.number(todo))
...@@ -69,7 +69,8 @@ class DependencyFilter(Filter): ...@@ -69,7 +69,8 @@ class DependencyFilter(Filter):
""" """
Returns True when there are no children that are uncompleted yet. Returns True when there are no children that are uncompleted yet.
""" """
children = self.todolist.children(p_todo.attributes['number']) number = self.todolist.number(p_todo)
children = self.todolist.children(number)
uncompleted = [todo for todo in children if not todo.is_completed()] uncompleted = [todo for todo in children if not todo.is_completed()]
return not uncompleted return not uncompleted
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