MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / main

Function main

tools/python-3.11.9-amd64/Tools/scripts/stable_abi.py:626–751  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

624 return True
625
626def main():
627 parser = argparse.ArgumentParser(
628 description=__doc__,
629 formatter_class=argparse.RawDescriptionHelpFormatter,
630 )
631 parser.add_argument(
632 "file", type=Path, metavar='FILE',
633 help="file with the stable abi manifest",
634 )
635 parser.add_argument(
636 "--generate", action='store_true',
637 help="generate file(s), rather than just checking them",
638 )
639 parser.add_argument(
640 "--generate-all", action='store_true',
641 help="as --generate, but generate all file(s) using default filenames."
642 + " (unlike --all, does not run any extra checks)",
643 )
644 parser.add_argument(
645 "-a", "--all", action='store_true',
646 help="run all available checks using default filenames",
647 )
648 parser.add_argument(
649 "-l", "--list", action='store_true',
650 help="list available generators and their default filenames; then exit",
651 )
652 parser.add_argument(
653 "--dump", action='store_true',
654 help="dump the manifest contents (used for debugging the parser)",
655 )
656
657 actions_group = parser.add_argument_group('actions')
658 for gen in generators:
659 actions_group.add_argument(
660 gen.arg_name, dest=gen.var_name,
661 type=str, nargs="?", default=MISSING,
662 metavar='FILENAME',
663 help=gen.__doc__,
664 )
665 actions_group.add_argument(
666 '--unixy-check', action='store_true',
667 help=do_unixy_check.__doc__,
668 )
669 args = parser.parse_args()
670
671 base_path = args.file.parent.parent
672
673 if args.list:
674 for gen in generators:
675 print(f'{gen.arg_name}: {base_path / gen.default_path}')
676 sys.exit(0)
677
678 run_all_generators = args.generate_all
679
680 if args.generate_all:
681 args.generate = True
682
683 if args.all:

Callers 1

stable_abi.pyFile · 0.70

Calls 15

parse_argsMethod · 0.95
errorMethod · 0.95
parse_manifestFunction · 0.85
check_private_namesFunction · 0.85
check_dumpFunction · 0.85
generate_or_checkFunction · 0.85
do_unixy_checkFunction · 0.85
with_suffixMethod · 0.80
printFunction · 0.50
add_argumentMethod · 0.45
add_argument_groupMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected