Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example for an on-add hook that sets the project of newly added tasks to the current directory's name by default.
#!/usr/bin/env python
import json
import os
import sys
t = json.loads(sys.stdin.readline())
if not 'project' in t:
t['project'] = os.path.basename(os.getcwd())
print(json.dumps(t))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment