- Bump CMake to minimum version 3.8
- Set C++ standard to 17
- Remove CMAKE_LEGACY_CYGWIN_WIN32 compatibility mode
- Remove C++11 stuff
- Update documentation
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
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>
Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.
According to our test images all supported distributions have CMake > 3
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.
- `task delete` does add 'end' to modified JSON but not remove key 'start'
- Stop time tracking when task is deleted
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
When input data from taskwarrior (e.g. via bugwarrior) contains UTF-8-illegal characters, `on-modify.timewarrior` would fail:
```
Traceback (most recent call last):
File "$HOME/.task/hooks/on-modify.timewarrior", line 42, in <module>
old = json.loads(sys.stdin.readline())
File "/usr/lib/python3.6/codecs.py", line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 1042: invalid continuation byte
```
This is fixed by manually decoding from stdin's underlying binary I/O object and replacing encoding errors with the Unicode replacement character [1].
[1]: https://docs.python.org/3/library/codecs.html#error-handlers
If the description contained multiple lines, it would be formatted as a
bytes object, including Python's `b""` marker for byte literals and any
newlines. This would then be passed literally to `timew`, which would
then choke on it, because it would record the newlines in its database.
This patch simply gets rid of the string join/split operations and the
encoding, which solves the issue.
Since we pass arrays instead of strings to `subprocess.call`, we are not
subject to command injection security vulnerabilities.
Fixes: 0b6dbf7e12
Fixes the following error with Python 3.6.8:
```
File "$HOME/.task/hooks/on-modify.timewarrior", line 33
from __future__ import print_function
SyntaxError: from __future__ imports must occur at the beginning of the file
```
The taskwarrior extension script `on-modify.timewarrior` did not forward
modifications for description/tag/project to `timew`.
This resulted in non-existent tasks (with old tag etc) contiued to be
tracked and not updated
[Closes#105](https://github.com/GothenburgBitFactory/timewarrior/issues/105)
- 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