add(index): a generated plain text index of every result with its status and file (tooling)
This commit is contained in:
1 parent
5227268cc0
commit
b672a137f2
7 files changed
+1402
-523
No files matched your search
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
META = os.path.join(ROOT, "graphs", "theorems.json")
|
||||
OUT = os.path.join(ROOT, "graphs", "index.txt")
|
||||
|
||||
|
||||
def main():
|
||||
with open(META, "r", encoding="utf-8") as fh:
|
||||
data = json.load(fh)
|
||||
rows = []
|
||||
for n in sorted(data["nodes"], key=lambda x: (x["milestone"], x["id"])):
|
||||
rows.append(
|
||||
"\t".join([n["status"], n["milestone"], n["kind"], n["id"], n["file"]])
|
||||
)
|
||||
header = "\t".join(["status", "milestone", "kind", "name", "file"])
|
||||
with open(OUT, "w", encoding="utf-8") as fh:
|
||||
fh.write(header + "\n")
|
||||
fh.write("\n".join(rows) + "\n")
|
||||
print("wrote", os.path.relpath(OUT, ROOT), "with", len(rows), "results")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Reference in new issue
Block a user