Use interval array to determine whether there is data to display
Move interval truncation outside the loop, combine/rework 'no data' messages
Close#450
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
datetime.timedelta stores days, seconds and microseconds. Therefore the
seconds attribute only stores timedeltas of less than 24 hours. Use
total_seconds() instead which properly accounts for the days part.
- add main
- move algorithm to function
- use __future__ module
- introduce new style formatting
- restructure test_totals.t accordingly
- add test for empty range
- add tests for colored output
- Convert UTC time to local time in output
- Change single quote to double quote
- Use new style python formatting
- Make tests use current time
- Fix test for open interval
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 <module>
end = datetime.datetime.strptime(configuration['temp.report.end'], DATEFORMAT)
KeyError: 'temp.report.end'
This change fixed that for me.
- Improve totals.py extension script:
- Fix display issue if tags are shorter than string 'Totals'
- Fix issue when totals.py is called on empty database
- Add tests: test_totals.t