From 530c5191d448a5d902d2d7f99fa18d3f58ce7551 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sat, 6 Feb 2016 18:05:04 +0100 Subject: [PATCH] backends: Add a exception for recurrence template task in ID parser --- tasklib/backends.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tasklib/backends.py b/tasklib/backends.py index 76fce88..6e7d918 100644 --- a/tasklib/backends.py +++ b/tasklib/backends.py @@ -323,8 +323,10 @@ class TaskWarrior(Backend): id_lines = [l for l in output if l.startswith('Created task ')] # Complain loudly if it seems that more tasks were created - # Should not happen - if len(id_lines) != 1 or len(id_lines[0].split(' ')) != 3: + # Should not happen. + # Expected output: Created task 1. + # Created task 1 (recurrence template). + if len(id_lines) != 1 or len(id_lines[0].split(' ')) not in (3, 5): raise TaskWarriorException("Unexpected output when creating " "task: %s" % '\n'.join(id_lines)) -- 2.39.5