diff --git a/app.json b/app.json index ce77fcc..b96f697 100644 --- a/app.json +++ b/app.json @@ -22,6 +22,16 @@ "description": "What method to use for the Inbox, sequence or parallel", "value": "parallel", "required": false + }, + "TODODIST_PARALLEL_SUFFIX": { + "description": "What sequence of characters to use to identify parallel processed projects", + "value": "=", + "required": false + }, + "TODODIST_SERIAL_SUFFIX": { + "description": "What sequence of characters to use to identify serial processed projects", + "value": "-", + "required": false } } } \ No newline at end of file diff --git a/nextaction.py b/nextaction.py index e407382..69831d9 100755 --- a/nextaction.py +++ b/nextaction.py @@ -12,15 +12,17 @@ API_TOKEN = os.environ.get('TODOIST_API_KEY', None) NEXT_ACTION_LABEL = os.environ.get('TODOIST_NEXT_ACTION_LABEL', 'next_action') SYNC_DELAY = int(os.environ.get('TODOIST_SYNC_DELAY', '5')) INBOX_HANDLING = os.environ.get('TODOIST_INBOX_HANDLING', 'parallel') - +PARALLEL_SUFFIX = os.environ.get('TODOIST_PARALLEL_SUFFIX', '=') +SERIAL_SUFFIX = os.environ.get('TODOIST_SERIAL_SUFFIX', '-') def get_project_type(project): + """Identifies how a project should be handled""" name = project['name'].strip() if project['name'] == 'Inbox': return INBOX_HANDLING - elif name[-1] == '=': + elif name[-1] == PARALLEL_SUFFIX: return 'parallel' - elif name[-1] == '-': + elif name[-1] == SERIAL_SUFFIX: return 'serial'