From fa757f33d1e98fa3e6785b8381bfa447153cefae Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Thu, 4 Aug 2016 10:48:07 +0100 Subject: [PATCH] Only tag non-completed tasks in serial lists, resolves #1 --- nextaction.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nextaction.py b/nextaction.py index e9f11b7..64ab6d8 100755 --- a/nextaction.py +++ b/nextaction.py @@ -142,9 +142,11 @@ def main(): if item_type or len(child_items) > 0: # Process serial tagged items if item_type == 'serial': - for idx, child_item in enumerate(child_items): - if idx == 0: + for child_item in child_items: + first_found = False + if child_item['checked'] == 0 and not first_found: add_label(child_item, label_id) + first_found = True else: remove_label(child_item, label_id) # Process parallel tagged items or untagged parents