Commit 4efef4ec authored by Jacek Sowiński's avatar Jacek Sowiński

Remove no longer needed IndexError exceptions

MultiCommand._catch_todo_errors() prevents occuring of those.
parent 4d049970
...@@ -26,7 +26,6 @@ class DepriCommand(MultiCommand): ...@@ -26,7 +26,6 @@ class DepriCommand(MultiCommand):
p_args, p_todolist, p_out, p_err, p_prompt) p_args, p_todolist, p_out, p_err, p_prompt)
def execute_multi_specific(self): def execute_multi_specific(self):
try:
self.printer.add_filter(PrettyPrinterNumbers(self.todolist)) self.printer.add_filter(PrettyPrinterNumbers(self.todolist))
for todo in self.todos: for todo in self.todos:
...@@ -35,9 +34,6 @@ class DepriCommand(MultiCommand): ...@@ -35,9 +34,6 @@ class DepriCommand(MultiCommand):
self.out("Priority removed.") self.out("Priority removed.")
self.out(self.printer.print_todo(todo)) self.out(self.printer.print_todo(todo))
except IndexError:
self.error(self.usage())
def usage(self): def usage(self):
return """Synopsis: depri <NUMBER1> [<NUMBER2> ...]""" return """Synopsis: depri <NUMBER1> [<NUMBER2> ...]"""
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
from datetime import date, timedelta from datetime import date, timedelta
from topydo.lib.MultiCommand import MultiCommand from topydo.lib.MultiCommand import MultiCommand
from topydo.lib.Command import InvalidCommandArgument
from topydo.lib.Config import config from topydo.lib.Config import config
from topydo.lib.PrettyPrinterFilter import PrettyPrinterNumbers from topydo.lib.PrettyPrinterFilter import PrettyPrinterNumbers
from topydo.lib.RelativeDate import relative_date_to_date from topydo.lib.RelativeDate import relative_date_to_date
...@@ -52,7 +51,6 @@ class PostponeCommand(MultiCommand): ...@@ -52,7 +51,6 @@ class PostponeCommand(MultiCommand):
return offset_date return offset_date
try:
pattern = self.args[-1] pattern = self.args[-1]
self.printer.add_filter(PrettyPrinterNumbers(self.todolist)) self.printer.add_filter(PrettyPrinterNumbers(self.todolist))
...@@ -75,8 +73,6 @@ class PostponeCommand(MultiCommand): ...@@ -75,8 +73,6 @@ class PostponeCommand(MultiCommand):
else: else:
self.error("Invalid date pattern given.") self.error("Invalid date pattern given.")
break break
except (InvalidCommandArgument, IndexError):
self.error(self.usage())
def usage(self): def usage(self):
return "Synopsis: postpone [-s] <NUMBER> [<NUMBER2> ...] <PATTERN>" return "Synopsis: postpone [-s] <NUMBER> [<NUMBER2> ...] <PATTERN>"
......
...@@ -31,7 +31,6 @@ class PriorityCommand(MultiCommand): ...@@ -31,7 +31,6 @@ class PriorityCommand(MultiCommand):
def execute_multi_specific(self): def execute_multi_specific(self):
priority = None priority = None
try:
priority = self.args[-1] priority = self.args[-1]
self.printer.add_filter(PrettyPrinterNumbers(self.todolist)) self.printer.add_filter(PrettyPrinterNumbers(self.todolist))
...@@ -49,8 +48,6 @@ class PriorityCommand(MultiCommand): ...@@ -49,8 +48,6 @@ class PriorityCommand(MultiCommand):
self.out(self.printer.print_todo(todo)) self.out(self.printer.print_todo(todo))
else: else:
self.error("Invalid priority given.") self.error("Invalid priority given.")
except IndexError:
self.error(self.usage())
def usage(self): def usage(self):
return """Synopsis: pri <NUMBER1> [<NUMBER2> ...] <PRIORITY>""" return """Synopsis: pri <NUMBER1> [<NUMBER2> ...] <PRIORITY>"""
......
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