Nowadays the way to manage the time spent in a task in taskwarrior is using
hooks to add annotations to the tasks.
Nevertheless if you start and stop a task several times your annotations get
overflowed, furthermore that information already exists in the undo.data
file.
That's the reason of this merge request. To accomplish that I needed to:
Get the available task attributes to know what were the keys of undo.data
Create a parser of undo.data and save it in an object called history
Create a method to extract the active time of a task from that history.
That features are accomplished by:
_set_task_attrs method to obtain the available task attributes
TaskHistory class to parse the undo.data file of taskwarrior so as to be able to manage the change history of a task.
If you have a huge history of tasks, the parsing time of the undo.data is quite high, therefore I created the _load_history_from_source or _load_history_from_cache
active_time method for the Task class to measure the active time of a task based on it's history
Sorry for the huge PR :( . If you change your mind, I can split up this PR into 3 smaller ones.
@robgolding close the other MR if you feel like it.
Nowadays the way to manage the time spent in a task in taskwarrior is using hooks to add annotations to the tasks.
Nevertheless if you start and stop a task several times your annotations get overflowed, furthermore that information already exists in the
undo.data
file.That's the reason of this merge request. To accomplish that I needed to:
undo.data
undo.data
and save it in an object called historyThat features are accomplished by:
_set_task_attrs
method to obtain the available task attributesTaskHistory
class to parse theundo.data
file of taskwarrior so as to be able to manage the change history of a task.undo.data
is quite high, therefore I created the_load_history_from_source
or_load_history_from_cache
active_time
method for theTask
class to measure the active time of a task based on it's historySorry for the huge PR :( . If you change your mind, I can split up this PR into 3 smaller ones.
@robgolding close the other MR if you feel like it.