MCPcopy Create free account
hub / github.com/FastLED/FastLED / _prompt_object_file

Function _prompt_object_file

ci/inspect_obj.py:52–73  ·  view source on GitHub ↗
(build: Path)

Source from the content-addressed store, hash-verified

50
51
52def _prompt_object_file(build: Path) -> Path:
53 # Look for object files in .pio/build directory
54 build_dir = build / ".pio" / "build"
55 object_files: list[Path] = list(build_dir.rglob("*.o"))
56
57 if not object_files:
58 print("Error: No object files found", file=sys.stderr)
59 sys.exit(1)
60
61 print("\nSelect an object file:")
62 for i, obj_file in enumerate(object_files):
63 print(f" [{i}]: {obj_file.relative_to(build_dir)}")
64
65 while True:
66 try:
67 which = int(input("Enter the number of the object file to use: "))
68 if 0 <= which < len(object_files):
69 return object_files[which]
70 print("Error: Invalid selection", file=sys.stderr)
71 except ValueError:
72 print("Error: Invalid input", file=sys.stderr)
73 continue
74
75
76def cli() -> None:

Callers 1

cliFunction · 0.70

Calls 2

listClass · 0.85
printFunction · 0.50

Tested by

no test coverage detected