From b9bfa88fab4bc3fa24293539a365d0b5d56e02ab Mon Sep 17 00:00:00 2001 From: Daniel Santos-Olivan Date: Thu, 29 Jul 2021 16:22:32 +0200 Subject: [PATCH] Refactor argument synch -> sync --- PythonAPI/examples/generate_traffic.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PythonAPI/examples/generate_traffic.py b/PythonAPI/examples/generate_traffic.py index 1967a5af7..ba8bbdf0d 100755 --- a/PythonAPI/examples/generate_traffic.py +++ b/PythonAPI/examples/generate_traffic.py @@ -105,7 +105,7 @@ def main(): type=int, help='Port to communicate with TM (default: 8000)') argparser.add_argument( - '--asynch', + '--async', action='store_true', help='Activate asynchronous mode execution') argparser.add_argument( @@ -164,7 +164,7 @@ def main(): traffic_manager.set_random_device_seed(args.seed) settings = world.get_settings() - if not args.asynch: + if not args.async: traffic_manager.set_synchronous_mode(True) if not settings.synchronous_mode: synchronous_master = True @@ -309,7 +309,7 @@ def main(): all_actors = world.get_actors(all_id) # wait for a tick to ensure client receives the last transform of the walkers we have just created - if args.asynch or not synchronous_master: + if args.async or not synchronous_master: world.wait_for_tick() else: world.tick() @@ -331,14 +331,14 @@ def main(): traffic_manager.global_percentage_speed_difference(30.0) while True: - if not args.asynch and synchronous_master: + if not args.async and synchronous_master: world.tick() else: world.wait_for_tick() finally: - if not args.asynch and synchronous_master: + if not args.async and synchronous_master: settings = world.get_settings() settings.synchronous_mode = False settings.no_rendering_mode = False