mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-04-13 20:32:32 -05:00
refactor: review fixes, DRY coverage, filter test nav
- Extract compute_coverage to common.py (was duplicated) - Filter test cores from nav and emulator index - Use absolute URL for README download links - Consistent page titles with site name suffix - Safer mkdocs.yml nav rewrite with regex - Build all_platform_names once in gap analysis
This commit is contained in:
@@ -217,6 +217,27 @@ def resolve_local_file(
|
||||
return None, "not_found"
|
||||
|
||||
|
||||
def compute_coverage(platform_name: str, platforms_dir: str, db: dict) -> dict:
|
||||
"""Compute BIOS coverage for a platform using verify logic."""
|
||||
from verify import verify_platform
|
||||
config = load_platform_config(platform_name, platforms_dir)
|
||||
result = verify_platform(config, db)
|
||||
present = result["ok"] + result["untested"]
|
||||
pct = (present / result["total"] * 100) if result["total"] > 0 else 0
|
||||
return {
|
||||
"platform": config.get("platform", platform_name),
|
||||
"total": result["total"],
|
||||
"verified": result["ok"],
|
||||
"untested": result["untested"],
|
||||
"missing": result["missing"],
|
||||
"present": present,
|
||||
"percentage": pct,
|
||||
"mode": config.get("verification_mode", "existence"),
|
||||
"details": result["details"],
|
||||
"config": config,
|
||||
}
|
||||
|
||||
|
||||
def safe_extract_zip(zip_path: str, dest_dir: str) -> None:
|
||||
"""Extract a ZIP file safely, preventing zip-slip path traversal."""
|
||||
dest = os.path.realpath(dest_dir)
|
||||
|
||||
Reference in New Issue
Block a user