From: Tomas Babej Date: Sat, 8 Aug 2015 17:51:11 +0000 (+0200) Subject: Task: Move TW-specific deletion logic into TW backend X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/7b0f22cf6cf519ece57e5282412669f460859293?hp=c4d8c861713743f9bab0e95325c2af515a9182e5 Task: Move TW-specific deletion logic into TW backend --- diff --git a/tasklib/backends.py b/tasklib/backends.py index ad5bd6b..6bf11bb 100644 --- a/tasklib/backends.py +++ b/tasklib/backends.py @@ -201,3 +201,6 @@ class TaskWarrior(object): # altering the data before saving task.refresh(after_save=True) + def delete_task(self, task): + self.execute_command([task['uuid'], 'delete']) + diff --git a/tasklib/task.py b/tasklib/task.py index 7c6dff8..61f944a 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -586,7 +586,7 @@ class Task(TaskResource): if self.deleted: raise Task.DeletedTask("Task was already deleted") - self.warrior.execute_command([self['uuid'], 'delete']) + self.backend.delete_task(self) # Refresh the status again, so that we have updated info stored self.refresh(only_fields=['status', 'start', 'end'])