X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/5c5b35a097608b63c3d54acf2f07d5cb00e85796..15c5d693afb61c72f6a6984c25dacb8610b2d9a8:/tasklib/backends.py diff --git a/tasklib/backends.py b/tasklib/backends.py index c99d63f..e7b9a74 100644 --- a/tasklib/backends.py +++ b/tasklib/backends.py @@ -213,3 +213,11 @@ class TaskWarrior(object): def stop_task(self, task): self.execute_command([task['uuid'], 'stop']) + + def complete_task(self, task): + # Older versions of TW do not stop active task at completion + if self.version < VERSION_2_4_0 and task.active: + task.stop() + + self.execute_command([task['uuid'], 'done']) +