compile.py: rewrite all output messages and docstrings in English
This commit is contained in:
+13
-13
@@ -2,19 +2,19 @@
|
|||||||
"""Compile connectors/index.json + fragment.json + file hash scan → connectors.json
|
"""Compile connectors/index.json + fragment.json + file hash scan → connectors.json
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
python3 scripts/compile.py # scrive connectors/connectors.json
|
python3 scripts/compile.py # writes connectors/connectors.json
|
||||||
python3 scripts/compile.py --verify # verifica che l'indice esistente sia aggiornato
|
python3 scripts/compile.py --verify # checks existing index is up to date
|
||||||
|
|
||||||
Legge:
|
Reads:
|
||||||
- connectors/index.json — lista ordinata di id folder
|
- connectors/index.json — ordered list of connector folder ids
|
||||||
- connectors/<id>/fragment.json — entry dell'indice senza files[]
|
- connectors/<id>/fragment.json — index entry without files[]
|
||||||
- scansione fisica dei file — SHA-256 e size di ogni file nella cartella
|
- physical file scan — SHA-256 and size of every file in each folder
|
||||||
|
|
||||||
Produce:
|
Produces:
|
||||||
- connectors/connectors.json — indice completo con files[] e SHA-256
|
- connectors/connectors.json — full index with files[] and SHA-256
|
||||||
|
|
||||||
Esclusioni automatiche: fragment.json, connector.json, compile.sh, compile.py,
|
Auto-excluded: fragment.json, connector.json, compile.sh, compile.py,
|
||||||
update_hashes.py, e l'intera directory scripts/.
|
update_hashes.py, .DS_Store, and scripts/ directory.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
@@ -100,7 +100,7 @@ def write_index(connectors: list[dict]) -> None:
|
|||||||
with open(out_path, "w") as f:
|
with open(out_path, "w") as f:
|
||||||
json.dump(output, f, indent=2)
|
json.dump(output, f, indent=2)
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
print(f"\n✅ Scritto {out_path} ({len(connectors)} connector)")
|
print(f"\n✅ Written {out_path} ({len(connectors)} connectors)")
|
||||||
|
|
||||||
|
|
||||||
def verify_index() -> bool:
|
def verify_index() -> bool:
|
||||||
@@ -111,10 +111,10 @@ def verify_index() -> bool:
|
|||||||
fresh = compile_index()
|
fresh = compile_index()
|
||||||
|
|
||||||
if current["connectors"] == fresh:
|
if current["connectors"] == fresh:
|
||||||
print("✅ L'indice è aggiornato — nessuna modifica.")
|
print("✅ Index is up to date — no changes.")
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
print("❌ L'indice NON è aggiornato. Esegui compile.py per rigenerarlo.")
|
print("❌ Index is stale. Run compile.py to regenerate.")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user