File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ elbosc was here! 2020-04-30
Original file line number Diff line number Diff line change 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 ])
You can’t perform that action at this time.
0 commit comments