MCPcopy Create free account
hub / github.com/Da1sypetals/SnapViewer / cli

Function cli

convert_snap.py:293–309  ·  view source on GitHub ↗

Command-line interface to process a snapshot and write allocations.json + elements.db to a directory.

()

Source from the content-addressed store, hash-verified

291
292
293def cli():
294 """
295 Command-line interface to process a snapshot and write allocations.json + elements.db to a directory.
296 """
297 parser = argparse.ArgumentParser()
298 parser.add_argument("-i", "--input", required=True, type=str, help="Path to snapshot pickle")
299 parser.add_argument("-o", "--output", required=True, type=str, help="Output directory path")
300 parser.add_argument("-d", "--device", type=int, default=0, help="Device ID (default=0)")
301 args = parser.parse_args()
302
303 os.makedirs(args.output, exist_ok=True)
304 convert_pickle_to_dir(args.input, args.output, args.device)
305
306 print("Done.")
307 print(f"Output written to: {args.output}")
308 print(f" {os.path.join(args.output, ALLOCATIONS_FILE_NAME)}")
309 print(f" {os.path.join(args.output, DATABASE_FILE_NAME)}")
310
311
312if __name__ == "__main__":

Callers 1

convert_snap.pyFile · 0.85

Calls 1

convert_pickle_to_dirFunction · 0.85

Tested by

no test coverage detected