diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2019-05-24 22:19:42 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2019-05-24 22:19:42 +0530 |
commit | fca01b7e7b6e992932c114858284b2218ee0b1f5 (patch) | |
tree | 3a24e52e593ad854abd6cbccceae3993e49b2916 | |
parent | 6cbd67bb7232e2ed499a1b94b51d255cbaea0183 (diff) |
changed main.py
-rwxr-xr-x | main.py | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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() |