Expression-mode for del, depri, do, pri, postpone.
This required some refactoring in MultiCommand and ExpressionCommand. Whole part about processing flags was refactored. Code related to flags from DCommand was moved into MultiCommand and reused from there in all "multi" commands. New attribute: ExpressionCommand.last_argument. Should be set to True if command is using the last argument as something other than todo ID or part of an expression (as in case of postpone or pri). By default set to False. New method: MultiCommand.execute_not_multi(): wrapper for functionality not connected with todo IDs (like `topydo edit` or `topydo edit -d`). New attribute: MultiCommand.multi_mode: Should be set to True if user wants to operate on multiple todo items. True by default. New method: MultiCommand.get_todos_from_expr(): gets todo IDs based on expression and puts it in MultiCommand.todos. EditCommand._open_in_editor() now accepts only one argument - file to editing. It handles now also OSError exceptions. It is used also to opening todo.txt and done.txt. MultiCommand.get_todos() doesn't accept anymore todo IDs as an argument. Instead it's using inherited Expression.last_argument` to decide upon where to find todo IDs.
Showing
Please register or sign in to comment