def main(argv): parser = argparse.ArgumentParser() # Automatically includes help parser.add_argument('-viewer', action='store_true', help='enable viewer.') args = parser.parse_args() env = Environment() try: execute = lambda: solve_tamp(env) if args.viewer: execute_viewer(env, execute) else: execute() finally: if env.GetViewer() is not None: env.GetViewer().quitmainloop() RaveDestroy() print 'Done!'
def main(_): parser = argparse.ArgumentParser() parser.add_argument('-focus', action='store_true', help='use focused algorithm.') parser.add_argument('-viewer', action='store_true', help='enable viewer.') args = parser.parse_args() env = Environment() try: execute = lambda: solve_tamp(env, args.focus) if args.viewer: execute_viewer(env, execute) else: execute() finally: if env.GetViewer() is not None: env.GetViewer().quitmainloop() RaveDestroy() print 'Done!'