mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-29 12:58:51 -06:00
refactor: move verify, slots, crossref into packs
The three commands keep their parser, main and printing. Scans, scopes, report text, the JSON forms, the strict gate and the destinations file live in new packs modules, one subject each.
This commit is contained in:
1 parent
1e95a73a4d
commit
6ba52a9682
21 files changed
+897
-774
No files matched your search
@@ -0,0 +1,35 @@
|
||||
"""What a verify run hands a program: its JSON entries and the pack destinations file."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
from packs.verdicts import Status
|
||||
|
||||
|
||||
def json_details(details: list[dict], verbose: bool) -> list[dict]:
|
||||
"""The entries a JSON report lists: what needs attention, or every one.
|
||||
|
||||
--verbose shows each entry with its ground truth in the text report. It
|
||||
used to be accepted beside --json and dropped, the output byte for byte
|
||||
the same, so a script asking for the passing entries got nothing.
|
||||
"""
|
||||
return list(details) if verbose else [
|
||||
d for d in details if d["status"] != Status.OK or d.get("release_asset")
|
||||
]
|
||||
|
||||
|
||||
def write_pack_destinations(
|
||||
path: str,
|
||||
groups: list[tuple[list[str], str]],
|
||||
group_results: list[tuple[dict, list[str]]],
|
||||
) -> None:
|
||||
"""The paths each pack holds according to the report, per platform, as JSON."""
|
||||
destinations = {}
|
||||
for (result, names), (group, _rep) in zip(group_results, groups):
|
||||
for name, key in zip(names, group):
|
||||
destinations[name] = {
|
||||
"platform": key, "pack_destinations": result["pack_destinations"],
|
||||
}
|
||||
Path(path).write_text(json.dumps(destinations, indent=1, sort_keys=True))
|
||||
Reference in new issue
Block a user