mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-29 21:08:53 -06:00
refactor: leave the commands their own code
This commit is contained in:
1 parent
1f8e106974
commit
27330be60a
17 files changed
+47
-72
No files matched your search
@@ -47,6 +47,9 @@ if TYPE_CHECKING:
|
||||
from typing_extensions import Unpack
|
||||
|
||||
|
||||
# Platform verification
|
||||
|
||||
|
||||
_UNPLACED_REASONS = {
|
||||
"outside_bios_folder": "read in a folder the platform keeps outside the BIOS tree",
|
||||
"no_roms_directory": "read below a roms folder the platform's registry does not name",
|
||||
|
||||
@@ -47,6 +47,9 @@ from resolve.validation import (
|
||||
_REPO_PLATFORMS = str(REPO_ROOT / "platforms")
|
||||
|
||||
|
||||
# Emulator/system mode verification
|
||||
|
||||
|
||||
def _effective_validation_label(details: list[dict], validation_index: dict) -> str:
|
||||
"""Determine the bracket label for the report.
|
||||
|
||||
|
||||
@@ -61,6 +61,9 @@ if TYPE_CHECKING:
|
||||
_Outcome = tuple[list[dict], bool, "Callable[[], None] | None"]
|
||||
|
||||
|
||||
# Emulator/system mode pack generation
|
||||
|
||||
|
||||
class EmulatorPackOptions(TypedDict, total=False):
|
||||
"""The keyword options of generate_emulator_pack."""
|
||||
|
||||
|
||||
@@ -35,6 +35,9 @@ def _baseline_shortfall(excluded: int, absent: int) -> list[str]:
|
||||
return parts
|
||||
|
||||
|
||||
# Post-generation pack verification + manifest + SHA256SUMS
|
||||
|
||||
|
||||
def inject_manifest(zip_path: str, manifest: dict) -> None:
|
||||
"""Inject manifest.json into an existing ZIP pack.
|
||||
|
||||
|
||||
@@ -33,6 +33,9 @@ from resolve.validation import (
|
||||
)
|
||||
|
||||
|
||||
# Cross-reference: undeclared files used by cores
|
||||
|
||||
|
||||
def _build_expected(file_entry: dict, checks: list[str]) -> dict:
|
||||
"""Extract expected validation values from an emulator profile file entry."""
|
||||
expected: dict = {}
|
||||
|
||||
@@ -22,6 +22,9 @@ from resolve.packfiles import resolve_file
|
||||
from resolve.validation import validated_choice
|
||||
|
||||
|
||||
# Manifest generation (JSON inventory for install.py)
|
||||
|
||||
|
||||
@functools.cache
|
||||
def _registered(repo_root: str) -> frozenset[str]:
|
||||
"""The paths a repository's .gitignore registers as release assets, read
|
||||
|
||||
@@ -9,6 +9,9 @@ from resolve.categories import BIOS
|
||||
from resolve.nativemode import reads_file_contents
|
||||
|
||||
|
||||
# Output
|
||||
|
||||
|
||||
def _format_ground_truth_aggregate(ground_truth: list[dict]) -> str:
|
||||
"""Format ground truth as a single aggregated line.
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@ DEFAULT_BIOS_DIR = "bios"
|
||||
DEFAULT_EMULATORS_DIR = "emulators"
|
||||
|
||||
|
||||
# Status model: aligned with Batocera BiosStatus (batocera-systems:967-969)
|
||||
|
||||
|
||||
class Status:
|
||||
OK = "ok"
|
||||
UNTESTED = "untested" # file present, hash not confirmed: a warning, never --strict
|
||||
@@ -46,6 +49,9 @@ _SEVERITY_ORDER = {
|
||||
}
|
||||
|
||||
|
||||
# Verification functions
|
||||
|
||||
|
||||
def verify_entry_existence(
|
||||
file_entry: dict,
|
||||
local_path: str | None,
|
||||
@@ -218,6 +224,9 @@ def verify_entry_sha1(
|
||||
}
|
||||
|
||||
|
||||
# Severity mapping per platform
|
||||
|
||||
|
||||
def _emulator_severity(status: str, required: bool, hle_fallback: bool) -> str:
|
||||
"""Severity when the emulator's own code is the check.
|
||||
|
||||
|
||||
Reference in new issue
Block a user