From 2564f972d84027d9b1b538b2d2ec5459feaa95c7 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Sat, 5 Sep 2015 15:56:30 +0100 Subject: [PATCH] Remove Heroku support --- README.md | 16 +--------------- app.json | 37 ------------------------------------- nextaction.py | 21 ++++++++------------- 3 files changed, 9 insertions(+), 65 deletions(-) delete mode 100644 app.json diff --git a/README.md b/README.md index b41d241..5291b48 100644 --- a/README.md +++ b/README.md @@ -37,18 +37,4 @@ Running NextAction NextAction will read your environment to retrieve your Todoist API key, so to run on a Linux/Mac OSX you can use the following commandline - TODOIST_API_KEY="XYZ" python nextaction.py - -Heroku Support --------------- - -[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy) - -This package is ready to be pushed to a Heroku instance with minimal configuration values: - -* ```TODOIST_API_KEY``` - Your Todoist API Key -* ```TODOIST_NEXT_ACTION_LABEL``` - The label to use in Todoist for next actions (defaults to next_action) -* ```TODOIST_SYNC_DELAY``` - The number of seconds to wait between syncs. (defaults to 5) -* ```TODOIST_INBOX_HANDLING``` - What method to use for the Inbox, sequence or parallel (defaults to parallel) -* ```TODODIST_PARALLEL_SUFFIX``` - What sequence of characters to use to identify parallel processed projects (defaults to =) -* ```TODODIST_SERIAL_SUFFIX``` - What sequence of characters to use to identify serial processed projects (defaults to -) \ No newline at end of file + python nextaction.py -a diff --git a/app.json b/app.json deleted file mode 100644 index b96f697..0000000 --- a/app.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "NextAction", - "description": "Todoist API application to provide a auto-populated next action label", - "repository": "https://github.com/nikdoof/NextAction", - "keywords": ["python"], - "env": { - "TODOIST_API_KEY": { - "description": "Your Todoist API Key", - "required": true - }, - "TODOIST_NEXT_ACTION_LABEL": { - "description": "The Todoist label to use for next actions.", - "value": "next_action", - "required": false - }, - "TODOIST_SYNC_DELAY": { - "description": "The number of seconds to wait between syncs.", - "value": "5", - "required": false - }, - "TODOIST_INBOX_HANDLING": { - "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 f683d10..a1199bf 100755 --- a/nextaction.py +++ b/nextaction.py @@ -2,7 +2,6 @@ import time import logging -import os import sys import argparse from datetime import datetime @@ -34,24 +33,20 @@ def get_subitems(items, parent_item=None): def main(): parser = argparse.ArgumentParser() - parser.add_argument('-a', '--api_key', help='Todoist API Key', - default=os.environ.get('TODOIST_API_KEY', None)) - parser.add_argument('-l', '--label', help='The next action label to use', - default=os.environ.get('TODOIST_NEXT_ACTION_LABEL', 'next_action')) - parser.add_argument('-d', '--delay', help='Specify the delay in seconds between syncs', - default=int(os.environ.get('TODOIST_SYNC_DELAY', '5')), type=int) + parser.add_argument('-a', '--api_key', help='Todoist API Key') + 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=5, type=int) parser.add_argument('--debug', help='Enable debugging', action='store_true') parser.add_argument('--inbox', help='The method the Inbox project should be processed', - default=os.environ.get('TODOIST_INBOX_HANDLING', 'parallel'), - choices=['parallel', 'serial']) - parser.add_argument('--parallel_suffix', default=os.environ.get('TODOIST_PARALLEL_SUFFIX', '=')) - parser.add_argument('--serial_suffix', default=os.environ.get('TODOIST_SERIAL_SUFFIX', '-')) + default='parallel', choices=['parallel', 'serial']) + parser.add_argument('--parallel_suffix', default='=') + parser.add_argument('--serial_suffix', default='-') parser.add_argument('--hide_future', help='Hide future dated next actions until the specified number of days', - default=int(os.environ.get('TODOIST_HIDE_FUTURE', '7')), type=int) + default=7, type=int) args = parser.parse_args() # Set debug - if args.debug or os.environ.get('TODOIST_DEBUG', None): + if args.debug: log_level = logging.DEBUG else: log_level = logging.INFO