Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save modifications #14

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions on-modify.relative-recur
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python
# https://github.com/JensErat/task-relative-recur

from __future__ import print_function
from builtins import str
Expand Down Expand Up @@ -36,13 +37,19 @@ modified = json.loads(modified)
# Has a task with UDA been marked as completed?
if (UDA_DUE in original or UDA_WAIT in original) and original['status']!='completed' and modified['status']=='completed':
del original['modified']

# have follow-up task be created without active time created by time tracking hook https://github.com/kostajh/taskwarrior-time-tracking-hook
if 'totalactivetime' in original:
Fongshway marked this conversation as resolved.
Show resolved Hide resolved
del original['totalactivetime']
if 'start' in original:
del original['start']
if UDA_DUE in original:
original['due'] = calc(modified['end'] + '+' + original[UDA_DUE])
if UDA_WAIT in original:
original['wait'] = calc(modified['end'] + '+' + original[UDA_WAIT])
original['scheduled'] = calc(modified['end'] + '+' + original[UDA_WAIT])
original['status'] = 'waiting'

else:
original['status'] = 'pending'
print('Created follow-up task')
Expand Down