Skip to content

Instantly share code, notes, and snippets.

@wbsch
Created March 5, 2015 19:25
Show Gist options
  • Save wbsch/ded3ae2a56cdd13dbb9f to your computer and use it in GitHub Desktop.
Save wbsch/ded3ae2a56cdd13dbb9f to your computer and use it in GitHub Desktop.
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