initial checkin
This commit is contained in:
commit
2362235231
3 changed files with 43 additions and 0 deletions
0
task_status/__init__.py
Normal file
0
task_status/__init__.py
Normal file
26
task_status/task_status.py
Executable file
26
task_status/task_status.py
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env python
|
||||
import subprocess
|
||||
import json
|
||||
from datetime import date
|
||||
from dateutil.relativedelta import relativedelta, MO
|
||||
|
||||
|
||||
def main():
|
||||
today = date.today()
|
||||
last_monday = today + relativedelta(weekday=MO(-2))
|
||||
|
||||
tasks = subprocess.run(
|
||||
["task", "+status", f"end.after:{last_monday}", "export"], capture_output=True
|
||||
)
|
||||
|
||||
entries = json.loads(tasks.stdout.decode())
|
||||
last_project = ""
|
||||
for entry in entries:
|
||||
if entry["project"] != last_project:
|
||||
last_project = entry["project"]
|
||||
print(f"* {entry['project']}")
|
||||
print(f"\t* {entry['description']}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue