timewarrior: Add hash and plus to taskwarrior tags
Add a hash sign in front of 'project' tags received from taskwarrior (i.e. where it is `project:something` it will end up as #something in timewarrior. Similarly, add a plus sign in front of tags: `+mytag`. Only descriptions will be left as-is in translating from taskwarrior to timewarrior. This should make finding tags and projects specifically much easier in timewarrior (e.g. for counting up the total time spent on a single project).
This commit is contained in:
parent
23793795d6
commit
dfb9d7ff01
1 changed files with 2 additions and 2 deletions
|
@ -55,10 +55,10 @@ def extract_tags_from(json_obj):
|
||||||
tags = [json_obj['description']]
|
tags = [json_obj['description']]
|
||||||
|
|
||||||
if 'project' in json_obj:
|
if 'project' in json_obj:
|
||||||
tags.append(json_obj['project'])
|
tags.append(f"#{json_obj['project']}")
|
||||||
|
|
||||||
if 'tags' in json_obj:
|
if 'tags' in json_obj:
|
||||||
tags.extend(json_obj['tags'])
|
tags.extend([f"+{tag}" for tag in json_obj['tags']])
|
||||||
|
|
||||||
return tags
|
return tags
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue