aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmain.py7
1 files 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()