refactor: share CLI options and default paths

core.paths holds the default database, platforms, emulators and bios paths, core.cli declares the options built on them (add_repo_inputs) and the --emulator/--system modes verify and generate_pack share. model.targets.target_scope answers --target for a command line, model.profiles.no_profile_for_systems the system with no emulator. tests/sources.declared_options reads the options a script declares through either form.
This commit is contained in:
Abdessamad Derraz committed 2026-11-20 18:28:46 +01:00
1 parent 348d5b51c3
commit cf03dcb2ef
50 files changed
+260 -405

No files matched your search

+3 -2
View File
@@ -5,6 +5,7 @@ from __future__ import annotations
import json
from pathlib import Path
from core.paths import PLATFORMS_DIR
from model.registry import list_release_pack_platforms
@@ -32,7 +33,7 @@ def get_page(platform: str, site: str = "") -> str:
return f"{site}{GET_DIR}/{platform}/"
def advertised(record: dict, platforms_dir: str = "platforms") -> dict:
def advertised(record: dict, platforms_dir: str = PLATFORMS_DIR) -> dict:
"""The record as the download tables show it: release_pack platforms only.
A release cut before a platform lost its release_pack still holds that
@@ -51,7 +52,7 @@ def advertised(record: dict, platforms_dir: str = "platforms") -> dict:
return {**record, "packs": packs}
def load_advertised(path: str | Path = RECORD, platforms_dir: str = "platforms") -> dict:
def load_advertised(path: str | Path = RECORD, platforms_dir: str = PLATFORMS_DIR) -> dict:
"""The committed record, reduced to the platforms a release publishes."""
return advertised(load_record(path), platforms_dir)