Commit 89707f4e authored by Jacek Sowiński's avatar Jacek Sowiński

MultiCommand.execute_* methods are now private

- execute_multi_specific() -> _execute_multi_specific()
- execute_not_multi() -> _execute_not_multi()
parent 4efef4ec
...@@ -25,7 +25,7 @@ class DepriCommand(MultiCommand): ...@@ -25,7 +25,7 @@ class DepriCommand(MultiCommand):
super(DepriCommand, self).__init__( super(DepriCommand, self).__init__(
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):
self.printer.add_filter(PrettyPrinterNumbers(self.todolist)) self.printer.add_filter(PrettyPrinterNumbers(self.todolist))
for todo in self.todos: for todo in self.todos:
......
...@@ -101,7 +101,7 @@ class EditCommand(MultiCommand): ...@@ -101,7 +101,7 @@ class EditCommand(MultiCommand):
else: else:
return None return None
def execute_multi_specific(self): def _execute_multi_specific(self):
self.printer.add_filter(PrettyPrinterNumbers(self.todolist)) self.printer.add_filter(PrettyPrinterNumbers(self.todolist))
temp_todos = self._todos_to_temp() temp_todos = self._todos_to_temp()
...@@ -121,7 +121,7 @@ class EditCommand(MultiCommand): ...@@ -121,7 +121,7 @@ class EditCommand(MultiCommand):
else: else:
self.error(self.usage()) self.error(self.usage())
def execute_not_multi(self): def _execute_not_multi(self):
if self.edit_archive: if self.edit_archive:
archive = config().archive() archive = config().archive()
......
...@@ -40,7 +40,7 @@ class PostponeCommand(MultiCommand): ...@@ -40,7 +40,7 @@ class PostponeCommand(MultiCommand):
if p_opt == '-s': if p_opt == '-s':
self.move_start_date = True self.move_start_date = True
def execute_multi_specific(self): def _execute_multi_specific(self):
def _get_offset(p_todo): def _get_offset(p_todo):
offset = p_todo.tag_value( offset = p_todo.tag_value(
config().tag_due(), date.today().isoformat()) config().tag_due(), date.today().isoformat())
......
...@@ -28,7 +28,7 @@ class PriorityCommand(MultiCommand): ...@@ -28,7 +28,7 @@ class PriorityCommand(MultiCommand):
self.last_argument = True self.last_argument = True
def execute_multi_specific(self): def _execute_multi_specific(self):
priority = None priority = None
priority = self.args[-1] priority = self.args[-1]
......
...@@ -113,7 +113,7 @@ class DCommand(MultiCommand): ...@@ -113,7 +113,7 @@ class DCommand(MultiCommand):
""" """
pass pass
def execute_multi_specific(self): def _execute_multi_specific(self):
old_active = self._active_todos() old_active = self._active_todos()
for todo in self.todos: for todo in self.todos:
......
...@@ -100,14 +100,14 @@ class MultiCommand(ExpressionCommand): ...@@ -100,14 +100,14 @@ class MultiCommand(ExpressionCommand):
else: else:
return None return None
def execute_multi_specific(self): def _execute_multi_specific(self):
""" """
Operations specific for particular command dealing with multiple todo Operations specific for particular command dealing with multiple todo
IDs. IDs.
""" """
pass pass
def execute_not_multi(self): def _execute_not_multi(self):
""" """
Some commands can do something else besides operating on multiple todo Some commands can do something else besides operating on multiple todo
IDs. This method is a wrapper for those other operations. IDs. This method is a wrapper for those other operations.
...@@ -121,13 +121,13 @@ class MultiCommand(ExpressionCommand): ...@@ -121,13 +121,13 @@ class MultiCommand(ExpressionCommand):
self._process_flags() self._process_flags()
if not self.multi_mode: if not self.multi_mode:
self.execute_not_multi() self._execute_not_multi()
else: else:
self.get_todos() self.get_todos()
todo_errors = self._catch_todo_errors() todo_errors = self._catch_todo_errors()
if not todo_errors: if not todo_errors:
self.execute_multi_specific() self._execute_multi_specific()
else: else:
for error in todo_errors: for error in todo_errors:
self.error(error) self.error(error)
......
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