MCPcopy Index your code
hub / github.com/RustPython/RustPython / main

Function main

scripts/update_lib/cmd_copy_lib.py:86–107  ·  view source on GitHub ↗
(argv: list[str] | None = None)

Source from the content-addressed store, hash-verified

84
85
86def main(argv: list[str] | None = None) -> int:
87 parser = argparse.ArgumentParser(
88 description=__doc__,
89 formatter_class=argparse.RawDescriptionHelpFormatter,
90 )
91 parser.add_argument(
92 "path",
93 type=pathlib.Path,
94 help="Source path containing /Lib/ (e.g., cpython/Lib/dataclasses.py)",
95 )
96
97 args = parser.parse_args(argv)
98
99 try:
100 copy_lib(args.path)
101 return 0
102 except ValueError as e:
103 print(f"Error: {e}", file=sys.stderr)
104 return 1
105 except FileNotFoundError as e:
106 print(f"Error: {e}", file=sys.stderr)
107 return 1
108
109
110if __name__ == "__main__":

Callers 1

cmd_copy_lib.pyFile · 0.70

Calls 4

parse_argsMethod · 0.95
copy_libFunction · 0.85
printFunction · 0.50
add_argumentMethod · 0.45

Tested by

no test coverage detected