Removed pngs from chain json

This commit is contained in:
Max
2026-06-01 14:33:19 +02:00
parent 8d9abc8cb2
commit 816a28986c
2 changed files with 47 additions and 3772 deletions
-3772
View File
File diff suppressed because one or more lines are too long
+47
View File
@@ -0,0 +1,47 @@
#!/usr/bin/env python3
from __future__ import annotations
import argparse
from pathlib import Path
def remove_icon_png_base64_lines(path: Path) -> int:
original = path.read_text(encoding="utf-8")
lines = original.splitlines(keepends=True)
kept_lines = []
removed = 0
for line in lines:
if '"icon_png_base64"' in line:
removed += 1
continue
kept_lines.append(line)
if removed:
path.write_text("".join(kept_lines), encoding="utf-8")
return removed
def main() -> int:
parser = argparse.ArgumentParser(
description="Remove icon_png_base64 fields from atc_chains.json while preserving all other text."
)
parser.add_argument(
"path",
nargs="?",
default="atc_chains.json",
help="Path to the JSON file to rewrite in place.",
)
args = parser.parse_args()
path = Path(args.path)
removed = remove_icon_png_base64_lines(path)
print(f"Removed {removed} icon_png_base64 field(s) from {path}.")
return 0
if __name__ == "__main__":
raise SystemExit(main())