def execute(arguments): player_string = player_options[arguments.m] player_object = lazy_load_object(player_string) game = PlayerThread(player_object) game.play_game((arguments.a,arguments.p))
def execute(arguments): # To extract the viewer object, we must load the module, # and then directly use its __dict__ to construct the # requested object viewer_class_string = viewer_options[arguments.m] viewer_object = lazy_load_object(viewer_class_string) viewer = ViewerThread(viewer_object) if viewer.connect((arguments.a,arguments.v)): try: while viewer.viewing: time.sleep(0.5) except KeyboardInterrupt: logger.info('Viewing stop request received') viewer.viewing = False