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()
|
parser = argparse.ArgumentParser()
|
||||||
FUNCTION_MAP = {'overspeed' : speedlim,
|
FUNCTION_MAP = {'overspeed' : speedlim, 'sleep-detector' : sleepiness, 'sudden-braking' : brakes, 'drunk' : drunk }
|
||||||
'sleep-detector' : sleepiness,
|
parser.add_argument('function', choices=list(FUNCTION_MAP))
|
||||||
'sudden-braking' : brakes,
|
|
||||||
'drunk' : drunk }
|
|
||||||
parser.add_argument('function', choices=FUNCTION_MAP.keys())
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
func = FUNCTION_MAP[args.function]
|
func = FUNCTION_MAP[args.function]
|
||||||
func()
|
func()
|
||||||
|
|
Loading…
Reference in New Issue