From 68fdcc0b2060f8143f7f168c606f7724cdf6968f Mon Sep 17 00:00:00 2001 From: Davis <4967021+davisdude@users.noreply.github.com> Date: Wed, 14 Feb 2018 00:49:53 -0500 Subject: [PATCH] Fixed error from totals.py while timer is active I got the following error when I tried to run totals.py while a task was not finished: Traceback (most recent call last): File "/home/davis/.timewarrior/extensions/totals.py", line 101, in end = datetime.datetime.strptime(configuration['temp.report.end'], DATEFORMAT) KeyError: 'temp.report.end' This change fixed that for me. --- ext/totals.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/totals.py b/ext/totals.py index 78dbcfe3..f6fe8c91 100755 --- a/ext/totals.py +++ b/ext/totals.py @@ -97,6 +97,11 @@ if 'temp.report.start' not in configuration: print('There is no data in the database') exit() +if 'temp.report.end' not in configuration: + configuration.update( { + 'temp.report.end': datetime.datetime.now().strftime( '%Y%m%dT%H%M%SZ' ) + } ) + start = datetime.datetime.strptime(configuration['temp.report.start'], DATEFORMAT) end = datetime.datetime.strptime(configuration['temp.report.end'], DATEFORMAT)