From fca01b7e7b6e992932c114858284b2218ee0b1f5 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Fri, 24 May 2019 22:19:42 +0530 Subject: [PATCH] changed main.py --- main.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index e24980f..698fa4f 100755 --- a/main.py +++ b/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()