Skip to content

Commit 30aae92

Browse files
author
Elliot Boschwitz
authored
Added script for new hire PR submission (#471)
1 parent 30dcde1 commit 30aae92

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

employee_registry.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
elbosc was here! 2020-04-30

new_hire.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Designed for new hires to complete their first PR.
2+
# Writes to 'employee_registry.txt' by calling `python new_hire.py <alias>`
3+
4+
from datetime import date
5+
import os
6+
import sys
7+
import click
8+
from utility import ROOT_DIR
9+
10+
def register_alias(alias):
11+
"""
12+
Appends text to 'employee_registry.txt'
13+
"""
14+
with open(os.path.join(ROOT_DIR, 'employee_registry.txt'), 'a') as f:
15+
f.write('{0} was here!\t{1}\n'.format(alias, date.today()).expandtabs(50))
16+
17+
if __name__ == "__main__":
18+
if len(sys.argv) != 2:
19+
click.secho("`new_hire.py` takes one string as an argument. "
20+
"Please provide your alias surrounded in strings, "
21+
"i.e. \"elbosc\".", err=True)
22+
else:
23+
register_alias(sys.argv[1])

0 commit comments

Comments
 (0)