From 861c7e1b101896bfb06a29d9f032346f5937cbd8 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Sat, 12 Dec 2015 14:35:08 +0000 Subject: [PATCH] Add "onetime" option to force a single sync only --- nextaction.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nextaction.py b/nextaction.py index 77d7a83..20206d0 100755 --- a/nextaction.py +++ b/nextaction.py @@ -45,6 +45,7 @@ def main(): parser.add_argument('--serial_suffix', default='_') 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') args = parser.parse_args() # Set debug @@ -131,6 +132,9 @@ def main(): item.update(labels=labels) api.commit() + + if args.onetime: + break logging.debug('Sleeping for %d seconds', args.delay) time.sleep(args.delay)