-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added script for new hire PR submission (#471)
- Loading branch information
Elliot Boschwitz
authored
Apr 30, 2020
1 parent
30dcde1
commit 30aae92
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
elbosc was here! 2020-04-30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Designed for new hires to complete their first PR. | ||
# Writes to 'employee_registry.txt' by calling `python new_hire.py <alias>` | ||
|
||
from datetime import date | ||
import os | ||
import sys | ||
import click | ||
from utility import ROOT_DIR | ||
|
||
def register_alias(alias): | ||
""" | ||
Appends text to 'employee_registry.txt' | ||
""" | ||
with open(os.path.join(ROOT_DIR, 'employee_registry.txt'), 'a') as f: | ||
f.write('{0} was here!\t{1}\n'.format(alias, date.today()).expandtabs(50)) | ||
|
||
if __name__ == "__main__": | ||
if len(sys.argv) != 2: | ||
click.secho("`new_hire.py` takes one string as an argument. " | ||
"Please provide your alias surrounded in strings, " | ||
"i.e. \"elbosc\".", err=True) | ||
else: | ||
register_alias(sys.argv[1]) |