Commit 7a8220a7 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Make dot subsubcommand robust against invalid todo numbers

parent 42c553d5
......@@ -114,13 +114,17 @@ class DepCommand(Command):
self.printer = DotPrinter(self.todolist)
arg = self.argument(1)
todo = self.todolist.todo(arg)
todos = set([self.todolist.todo(arg)])
todos |= set(self.todolist.children(todo))
todos |= set(self.todolist.parents(todo))
try:
todo = self.todolist.todo(arg)
todos = set([self.todolist.todo(arg)])
todos |= set(self.todolist.children(todo))
todos |= set(self.todolist.parents(todo))
self.out(self.printer.print_list(todos))
except InvalidTodoException:
self.error("Invalid todo number given.")
self.out(self.printer.print_list(todos))
def execute(self):
if not super(DepCommand, self).execute():
......
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