]> us-delaporte.pagekite.me Git - dotfiles.git/blob - files/ts/tasks.py
Add invoke function for recording wins
[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}")
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 vasl(c):
47 '''Submit time off'''
48 c.run(f"firefox https://my.techservices.illinois.edu/vacation/submitdays.asp")
49 browse(c, "https://outlook.office.com/calendar/view/week")
50
51
52 @task(vasl)
53 def timesheets(c):
54 '''Reconcile time off between reporting systems'''
55 browse(c, "https://outlook.office.com/calendar/view/month")
56 code(c, f"{HOME}/src/Learn_RobotFramework_IllinoisPTR")
57
58 @task(journal)
59 def daily(c):
60 '''Open daily reminders file for this month'''
61 code(c, f'{JOURNAL}/{MONTH}-daily.md')
62
63
64 @task(daily)
65 def status(c):
66 '''Check on status of priorities'''
67
68 browse(c, 'https://github.com/orgs/techservicesillinois/projects/10/views/11')
69
70
71 @task
72 def backlog(c):
73 '''Prep for backlog grooming'''
74 browse(c, 'https://github.com/orgs/techservicesillinois/projects/10/views/7')
75
76
77 @task(journal)
78 def retro(c):
79 '''Prep for team retrospective meeting'''
80
81 # Create and open retro notes file
82 retro_file = f'{JOURNAL}/{TODAY}.Retro.md'
83 if(not os.path.exists(retro_file)):
84 c.run(f'{HOME}/envs/jinja/bin/jinja2 -D DATE={TODAY} {JOURNAL}/Retro.Template.md > {retro_file}')
85 code(c, retro_file)
86
87 # Close issues this sprint
88 browse(c, 'https://github.com/orgs/techservicesillinois/projects/10/views/5')
89
90 # Shared folder for archiving Retro notes
91 browse(c, f'{SECDEV_LIMITED}')
92
93
94
95 @task(journal)
96 def wins(c):
97 '''For recording team wins'''
98 code(c, f'{JOURNAL}/{YEAR}-Wins.md')
99
100