aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2019-05-24 22:19:42 +0530
committerNavan Chauhan <navanchauhan@gmail.com>2019-05-24 22:19:42 +0530
commitfca01b7e7b6e992932c114858284b2218ee0b1f5 (patch)
tree3a24e52e593ad854abd6cbccceae3993e49b2916
parent6cbd67bb7232e2ed499a1b94b51d255cbaea0183 (diff)
changed main.py
-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()