changed main.py
This commit is contained in:
parent
6cbd67bb72
commit
fca01b7e7b
7
main.py
7
main.py
|
@ -335,11 +335,8 @@ def brakes():
|
|||
#####################################################
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
FUNCTION_MAP = {'overspeed' : speedlim,
|
||||
'sleep-detector' : sleepiness,
|
||||
'sudden-braking' : brakes,
|
||||
'drunk' : drunk }
|
||||
parser.add_argument('function', choices=FUNCTION_MAP.keys())
|
||||
FUNCTION_MAP = {'overspeed' : speedlim, 'sleep-detector' : sleepiness, 'sudden-braking' : brakes, 'drunk' : drunk }
|
||||
parser.add_argument('function', choices=list(FUNCTION_MAP))
|
||||
args = parser.parse_args()
|
||||
func = FUNCTION_MAP[args.function]
|
||||
func()
|
||||
|
|
Loading…
Reference in New Issue