From 3e45c4b6ee9be01323e901331e2d1e2c2d8ef474 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Tue, 7 Apr 2015 18:34:19 +0200 Subject: [PATCH] Remove non-pirate version of the hook --- on-add-shift-all-recurrence | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100755 on-add-shift-all-recurrence diff --git a/on-add-shift-all-recurrence b/on-add-shift-all-recurrence deleted file mode 100755 index 87817f8..0000000 --- a/on-add-shift-all-recurrence +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/python - -import sys -import os -from tasklib.task import Task, TaskWarrior - -time_attributes = ('wait', 'until', 'scheduled') - -def is_new_local_recurrence_child_task(task): - # Do not affect tasks not spun by recurrence - if not task['parent']: - return False - - # Newly created recurrence tasks actually have - # modified field copied from the parent, thus - # older than entry field (until their ID is generated) - if (task['modified'] - task['entry']).total_seconds() < 0: - return True - -task = Task.from_input() -tw = TaskWarrior(data_location=os.path.dirname(os.path.dirname(sys.argv[0]))) -tw.config.update(dict(recurrence="no")) - -if is_new_local_recurrence_child_task(task): - parent = tw.tasks.get(uuid=task['parent']) - parent_due_shift = task['due'] - parent['due'] - for attr in time_attributes: - if parent[attr]: - task[attr] = parent[attr] + parent_due_shift - -print task.export_data() -- 2.39.2