Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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])