def display_backends_cli(ai_args=""): """ command line interface to run this script in standalone """ db_parser = argparse.ArgumentParser( description='Test the display_backend Two_Canvas).') db_parser.add_argument( '--test1', '--t1', action='store_true', default=False, dest='sw_test1', help='Run two_canvas_class_test1() with a static graphic') db_parser.add_argument( '--test2', '--t2', action='store_true', default=False, dest='sw_test2', help='Run two_canvas_class_test2() with a dynamic graphic') effective_args = design_help.get_effective_args(ai_args) db_args = db_parser.parse_args(effective_args) r_dbc = 0 print("dbg111: start testing display_backends.py") if (db_args.sw_test1): r_dbc = two_canvas_class_test1() elif (db_args.sw_test2): r_dbc = two_canvas_class_test2() print("dbg999: end of script") return (r_dbc)
def cli(self, cli_str=""): """ it emulates partially the previous behavior of the design functions partially depreciated: use it only to run the self-test or dump the constraint-file """ effective_args = design_help.get_effective_args(cli_str) aio_parser = argparse.ArgumentParser(description='AllInOne command Line Interface of {:s}'.format(self.design_name)) aio_parser.add_argument('--run_self_test','--rst', action='store', nargs='?', const='', default=None, dest='sw_run_self_test', help="run the design self-test used usually as non-regression-test") aio_parser.add_argument('--dump_constraint_file', '--dcf', action='store', default='', dest='sw_dump_constraint_file', help="write a python file containing the list of the design constraint. The file can be used as design constraint example") if(('-h' in effective_args)or('--help' in effective_args)): aio_parser.print_help() (aio_args, remaining_args) = aio_parser.parse_known_args([]) remaining_args = effective_args else: (aio_args, remaining_args) = aio_parser.parse_known_args(effective_args) print("dbg111: start a design") r_cli = 1 if(aio_args.sw_run_self_test!=None): #print("dbg596: aio_args.sw_run_self_test:", aio_args.sw_run_self_test) self.run_self_test(aio_args.sw_run_self_test) elif(aio_args.sw_dump_constraint_file!=''): self.dump_constraint_file(aio_args.sw_dump_constraint_file) else: r_cli = self.apply_cli_with_output_options(' '.join(remaining_args)) print("dbg999: end of design") return(r_cli)
def display_backends_cli(ai_args=""): """ command line interface to run this script in standalone """ db_parser = argparse.ArgumentParser(description="Test the display_backend Two_Canvas).") db_parser.add_argument( "--test1", "--t1", action="store_true", default=False, dest="sw_test1", help="Run two_canvas_class_test1() with a static graphic", ) db_parser.add_argument( "--test2", "--t2", action="store_true", default=False, dest="sw_test2", help="Run two_canvas_class_test2() with a dynamic graphic", ) effective_args = design_help.get_effective_args(ai_args) db_args = db_parser.parse_args(effective_args) r_dbc = 0 print("dbg111: start testing display_backends.py") if db_args.sw_test1: r_dbc = two_canvas_class_test1() elif db_args.sw_test2: r_dbc = two_canvas_class_test2() print("dbg999: end of script") return r_dbc
def positioning_cli(ai_args=""): """ it is the command line interface of positioning.py when it is used in standalone """ posi_parser = argparse.ArgumentParser(description='Test the positioning API') posi_parser.add_argument('--test1','--t1', action='store_true', default=False, dest='sw_test1', help='First test to check place_plank.') effective_args = design_help.get_effective_args(ai_args) posi_args = posi_parser.parse_args(effective_args) print("dbg111: start testing positioning.py") if(posi_args.sw_test1): positioning_test1() print("dbg999: end of script")
def bare_design_test_cli(ai_args=""): """ command line interface to run this script in standalone """ bd_parser = argparse.ArgumentParser(description='CLI to test the bare_design class') bd_parser.add_argument('--test1','--t1', action='store_true', default=False, dest='sw_test1', help='Run bare_design_test1()') effective_args = design_help.get_effective_args(ai_args) bd_args = bd_parser.parse_args(effective_args) r_bdtc = 0 #print("dbg111: start testing bare_design.py") if(bd_args.sw_test1): r_bdtc = bare_design_test1() #print("dbg999: end of script") return(r_bdtc)
def outline_backends_cli(ai_args=""): """ command line interface to run this script in standalone """ ob_parser = argparse.ArgumentParser(description='Test the outline_backends API.') ob_parser.add_argument('--test1','--t1', action='store_true', default=False, dest='sw_test1', help='Run outline_arc_line_test1()') effective_args = design_help.get_effective_args(ai_args) ob_args = ob_parser.parse_args(effective_args) r_obc = 0 print("dbg111: start testing outline_backends.py") if(ob_args.sw_test1): r_obc = outline_arc_line_test1() print("dbg999: end of script") return(r_obc)
def outline_backends_cli(ai_args=""): """ command line interface to run this script in standalone """ ob_parser = argparse.ArgumentParser( description='Test the outline_backends API.') ob_parser.add_argument('--test1', '--t1', action='store_true', default=False, dest='sw_test1', help='Run outline_arc_line_test1()') effective_args = design_help.get_effective_args(ai_args) ob_args = ob_parser.parse_args(effective_args) r_obc = 0 print("dbg111: start testing outline_backends.py") if (ob_args.sw_test1): r_obc = outline_arc_line_test1() print("dbg999: end of script") return (r_obc)