Revert "Refactor argument synch -> sync", because async is reserved word in Python

This reverts commit 48bd1b45c0.
This commit is contained in:
bernatx 2021-07-30 00:20:12 +02:00 committed by bernat
parent 2d717a958e
commit 756e753826
1 changed files with 5 additions and 5 deletions

View File

@ -105,7 +105,7 @@ def main():
type=int, type=int,
help='Port to communicate with TM (default: 8000)') help='Port to communicate with TM (default: 8000)')
argparser.add_argument( argparser.add_argument(
'--async', '--asynch',
action='store_true', action='store_true',
help='Activate asynchronous mode execution') help='Activate asynchronous mode execution')
argparser.add_argument( argparser.add_argument(
@ -164,7 +164,7 @@ def main():
traffic_manager.set_random_device_seed(args.seed) traffic_manager.set_random_device_seed(args.seed)
settings = world.get_settings() settings = world.get_settings()
if not args.async: if not args.asynch:
traffic_manager.set_synchronous_mode(True) traffic_manager.set_synchronous_mode(True)
if not settings.synchronous_mode: if not settings.synchronous_mode:
synchronous_master = True synchronous_master = True
@ -309,7 +309,7 @@ def main():
all_actors = world.get_actors(all_id) 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 # wait for a tick to ensure client receives the last transform of the walkers we have just created
if args.async or not synchronous_master: if args.asynch or not synchronous_master:
world.wait_for_tick() world.wait_for_tick()
else: else:
world.tick() world.tick()
@ -331,14 +331,14 @@ def main():
traffic_manager.global_percentage_speed_difference(30.0) traffic_manager.global_percentage_speed_difference(30.0)
while True: while True:
if not args.async and synchronous_master: if not args.asynch and synchronous_master:
world.tick() world.tick()
else: else:
world.wait_for_tick() world.wait_for_tick()
finally: finally:
if not args.async and synchronous_master: if not args.asynch and synchronous_master:
settings = world.get_settings() settings = world.get_settings()
settings.synchronous_mode = False settings.synchronous_mode = False
settings.no_rendering_mode = False settings.no_rendering_mode = False