]> apps.delaporte.us Git - dotfiles.git/blob - files/ts/tasks.py
Fixup async
[dotfiles.git] / files / ts / tasks.py
1 # This file is meant to sit in ~ for use from all shells.
2 # ln -s ~/dotfiles/files/ts/tasks.py ~/tasks.py
3
4 from invoke import task
5
6 from datetime import datetime as dt
7 import os
8
9 HOME = os.path.expanduser('~')
10
11 TODAY = dt.now().strftime('%Y.%m.%d')
12 MONTH = dt.now().strftime('%m')
13 YEAR = dt.now().strftime('%Y')
14 JOURNAL = f"{HOME}/Journal/{YEAR}"
15
16 SECDEV_LIMITED=os.environ.get('SECDEV_LIMITED')
17
18
19 # Helper functions for a consistent experience
20
21 @task
22 def journal(c):
23 code(c, f'{HOME}/Journal')
24
25
26 def browse(c, url):
27 c.run(f"firefox {url}", asynchronous=True)
28
29
30 def code(c, path):
31 c.run(f"codium {path}")
32
33
34 def folder(c, path):
35 c.run(f"nemo {path}")
36
37
38
39 @task
40 def debug(c):
41 result = c.run('which minetest')
42 print(result.ok)
43
44
45 @task()
46 def dash(c):
47 c.run('wtfutil')
48
49
50 @task
51 def vasl(c):
52 '''Submit time off'''
53 browse(c, "https://my.techservices.illinois.edu/vacation/submitdays.asp")
54 browse(c, "https://outlook.office.com/calendar/view/week")
55
56
57 @task(vasl)
58 def timesheets(c):
59 '''Reconcile time off between reporting systems'''
60 browse(c, "https://outlook.office.com/calendar/view/month")
61 code(c, f"{HOME}/src/Learn_RobotFramework_IllinoisPTR")
62
63 @task(journal)
64 def daily(c):
65 '''Open daily reminders file for this month'''
66 code(c, f'{JOURNAL}/{MONTH}-daily.md')
67
68
69
70 @task()
71 def in_progress(c):
72 '''Show in progress items on the Kan-Ban board'''
73 browse(c, 'https://github.com/orgs/techservicesillinois/projects/10/views/11')
74
75
76 @task(daily, in_progress, dash)
77 def status(c):
78 '''Check on status of priorities'''
79 pass
80
81
82
83 @task
84 def backlog(c):
85 '''Prep for backlog grooming'''
86 browse(c, 'https://github.com/orgs/techservicesillinois/projects/10/views/7')
87
88
89 @task(journal)
90 def retro(c):
91 '''Prep for team retrospective meeting'''
92
93 # Create and open retro notes file
94 retro_file = f'{JOURNAL}/{TODAY}.Retro.md'
95 if(not os.path.exists(retro_file)):
96 c.run(f'{HOME}/envs/jinja/bin/jinja2 -D DATE={TODAY} {JOURNAL}/Retro.Template.md > {retro_file}')
97 code(c, retro_file)
98
99 # Close issues this sprint
100 browse(c, 'https://github.com/orgs/techservicesillinois/projects/10/views/5')
101
102 # Shared folder for archiving Retro notes
103 browse(c, f'{SECDEV_LIMITED}')
104
105
106
107 @task(journal)
108 def wins(c):
109 '''For recording team wins'''
110 code(c, f'{JOURNAL}/{YEAR}-Wins.md')
111
112
113