Skip to content

Commit

Permalink
Added script for new hire PR submission (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliot Boschwitz authored Apr 30, 2020
1 parent 30dcde1 commit 30aae92
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions employee_registry.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
elbosc was here! 2020-04-30
23 changes: 23 additions & 0 deletions new_hire.py
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])

0 comments on commit 30aae92

Please sign in to comment.