Allow bypass (0) and override to None (-1) start/end in DBus AddFact
Created by: ederag
#490 seemed to fix the shell-extension (https://github.com/projecthamster/hamster-shell-extension/pull/316#issuecomment-564145295),
but that overrides the parsed fact start_time with hamster_now
as a default.
Here is the 2012 state:
https://github.com/projecthamster/hamster/blob/80110affd6f0c3a91d739c09a78dffe7c06976a1/src/hamster-service#L117-L121
https://github.com/projecthamster/hamster/blob/80110affd6f0c3a91d739c09a78dffe7c06976a1/src/hamster/lib/stuff.py#L322-L323
so start and end times were taken from the parse string, and overridden only
if the separately given start_time
and end_time
were non-zero.
This prevents overriding the end_time with None for instance.
Proposition
Use 0
to mean "do not mess around with the parsed fact"
(just ignore this argument)
Use -1
as a special value to mean "replace with None
"
This way the full power of the new parser (including datetimes and relative times parsing) can be exploited in the shell-extension as well.
For instance one might try this branch: https://github.com/ederag/hamster/tree/AddFact-parse-times