From 4d41df2387bd402da18b452a04eb99ee7e680b9c Mon Sep 17 00:00:00 2001
From: Alexander Haselhoff <alexander.haselhoff@outlook.com>
Date: Tue, 12 May 2020 22:40:37 +0200
Subject: [PATCH] Stash

---
 autodoist.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/autodoist.py b/autodoist.py
index f0820fa..f538ca4 100644
--- a/autodoist.py
+++ b/autodoist.py
@@ -12,7 +12,7 @@ from datetime import datetime
 def main():
     """Main process function."""
     parser = argparse.ArgumentParser()
-    parser.add_argument('-a', '--api_key', help='Todoist API Key')
+    parser.add_argument('-a', '--api_key', help='Todoist API Key', default="a")
     parser.add_argument('-l', '--label', help='The next action label to use', default='next_action')
     parser.add_argument('-d', '--delay', help='Specify the delay in seconds between syncs', default=10, type=int)
     parser.add_argument('-r', '--recurring', help='Enable re-use of recurring lists', action='store_true')
@@ -144,6 +144,7 @@ def main():
             logging.exception('Error trying to sync with Todoist API: %s' % str(e))
         else:
             for project in api.projects.all():
+                print(project.data['name'])
 
                 # Get project type
                 project_type, project_type_changed = get_project_type(project)
@@ -234,7 +235,8 @@ def main():
                             item_type = project_type
                         
                         # Add labels to top items if they have no childern
-                        if len(child_items) == 0:
+                        # if len(child_items) == 0:
+                        if len(child_items) >= 0:
                             if item['parent_id'] == 0:
                                 if project_type == 'serial':
                                     if not first_found: