Browse Source

sim_vehicle.py: move exit handler and start message

Move them after the argument parser because otherwise they would display
and the handler be registered when using the 'help' option.
mission-4.1.18
Lucas De Marchi 9 years ago committed by Peter Barker
parent
commit
f5be0823f9
  1. 10
      Tools/autotest/sim_vehicle.py

10
Tools/autotest/sim_vehicle.py

@ -172,9 +172,6 @@ def kill_tasks(): @@ -172,9 +172,6 @@ def kill_tasks():
except Exception as e:
progress("kill_tasks failed: {}".format(str(e)))
# clean up processes at exit:
atexit.register(kill_tasks)
def check_jsbsim_version():
"""Assert that the JSBSim we will run is the one we expect to run"""
@ -217,8 +214,6 @@ def find_root_dir(): @@ -217,8 +214,6 @@ def find_root_dir():
"""Return path to root directory"""
return os.path.realpath(os.path.join(find_autotest_dir(), '../..'))
progress("Start")
# define and run parser
parser = CompatOptionParser("sim_vehicle.py",
epilog="eeprom.bin in the starting directory contains the parameters for your " \
@ -278,6 +273,11 @@ parser.add_option_group(group) @@ -278,6 +273,11 @@ parser.add_option_group(group)
cmd_opts, cmd_args = parser.parse_args()
# clean up processes at exit:
atexit.register(kill_tasks)
progress("Start")
if cmd_opts.sim_vehicle_sh_compatible and cmd_opts.jobs is None:
cmd_opts.jobs = 1

Loading…
Cancel
Save