From 1b4a953fd34dff11ffd327dc4ad3df2c285526df Mon Sep 17 00:00:00 2001 From: mpenning Date: Mon, 1 Jan 2024 05:05:12 -0600 Subject: [PATCH 1/2] Add TaskWarrior().purge_task() --- tasklib/backends.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tasklib/backends.py b/tasklib/backends.py index c6e87d5..a4e5167 100644 --- a/tasklib/backends.py +++ b/tasklib/backends.py @@ -362,6 +362,12 @@ def save_task(self, task): def delete_task(self, task): self.execute_command([task['uuid'], 'delete']) + def purge_task(self, task): + """ + Permanently remove the task. This causes data loss. + """ + self.execute_command([task['uuid'], 'purge']) + def start_task(self, task): self.execute_command([task['uuid'], 'start']) From 49d7472680dfbfa2a717d18b887312ade0ab0807 Mon Sep 17 00:00:00 2001 From: mpenning Date: Tue, 2 Jan 2024 07:24:17 -0600 Subject: [PATCH 2/2] Add a manual delete before purge --- tasklib/backends.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tasklib/backends.py b/tasklib/backends.py index a4e5167..e396a37 100644 --- a/tasklib/backends.py +++ b/tasklib/backends.py @@ -366,6 +366,7 @@ def purge_task(self, task): """ Permanently remove the task. This causes data loss. """ + self.execute_command([task['uuid'], 'delete']) self.execute_command([task['uuid'], 'purge']) def start_task(self, task):