dotfiles/config/scripts/totask

22 lines
415 B
Python
Executable file

#!/usr/bin/env python3
import taskw
import sys
tw = taskw.TaskWarrior()
total = 0
number = 0
statuses = set()
for task in tw._get_task_objects(*sys.argv[1:], 'export'):
statuses.add(task['status'])
if task['status'] not in {'pending', 'waiting'}:
continue
urgency = task['urgency']
if urgency <= 0:
continue
total += urgency
number += 1
print(f"Σ{total:.3f} #{number}")