mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Process task annotate
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
parent
fc383b73de
commit
2a3caad1cd
1 changed files with 14 additions and 0 deletions
|
@ -62,6 +62,14 @@ def extract_tags_from(json_obj):
|
|||
return tags
|
||||
|
||||
|
||||
def extract_annotation_from(json_obj):
|
||||
|
||||
if 'annotations' not in json_obj:
|
||||
return '\'\''
|
||||
|
||||
return json_obj['annotations'][0]['description']
|
||||
|
||||
|
||||
start_or_stop = ''
|
||||
|
||||
# Started task.
|
||||
|
@ -85,3 +93,9 @@ elif 'start' in new and 'start' in old:
|
|||
if old_tags != new_tags:
|
||||
subprocess.call(['timew', 'untag', '@1'] + old_tags + [':yes'])
|
||||
subprocess.call(['timew', 'tag', '@1'] + new_tags + [':yes'])
|
||||
|
||||
old_annotation = extract_annotation_from(old)
|
||||
new_annotation = extract_annotation_from(new)
|
||||
|
||||
if old_annotation != new_annotation:
|
||||
subprocess.call(['timew', 'annotate', '@1', new_annotation])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue