From 30aae92a0abca61a69b4c5f214db7678126dd2d4 Mon Sep 17 00:00:00 2001 From: Elliot Boschwitz Date: Thu, 30 Apr 2020 14:23:37 -0700 Subject: [PATCH] Added script for new hire PR submission (#471) --- employee_registry.txt | 1 + new_hire.py | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 employee_registry.txt create mode 100644 new_hire.py diff --git a/employee_registry.txt b/employee_registry.txt new file mode 100644 index 00000000..48d1d1e6 --- /dev/null +++ b/employee_registry.txt @@ -0,0 +1 @@ +elbosc was here! 2020-04-30 diff --git a/new_hire.py b/new_hire.py new file mode 100644 index 00000000..3df2c612 --- /dev/null +++ b/new_hire.py @@ -0,0 +1,23 @@ +# Designed for new hires to complete their first PR. +# Writes to 'employee_registry.txt' by calling `python new_hire.py ` + +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])