From 73361c7f89dc2d856949aa696d9cf910a458e779 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Thu, 4 Aug 2016 11:03:10 +0100 Subject: [PATCH] Add option to disable local disk caching of the todo list --- nextaction.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nextaction.py b/nextaction.py index 64ab6d8..0d96210 100755 --- a/nextaction.py +++ b/nextaction.py @@ -48,6 +48,7 @@ def main(): parser.add_argument('--hide_future', help='Hide future dated next actions until the specified number of days', default=7, type=int) parser.add_argument('--onetime', help='Update Todoist once and exit', action='store_true') + parser.add_argument('--nocache', help='Disables caching data to disk for quicker syncing', action='store_true') args = parser.parse_args() # Set debug @@ -64,7 +65,13 @@ def main(): # Run the initial sync logging.debug('Connecting to the Todoist API') - api = TodoistAPI(token=args.api_key) + + api_arguments = {'token': args.api_key} + if args.nocache: + logging.debug('Disabling local caching') + api_arguments['cache'] = None + + api = TodoistAPI(**api_arguments) logging.debug('Syncing the current state from the API') api.sync()