mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-23 18:17:53 -06:00
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:
1 parent
348d5b51c3
commit
cf03dcb2ef
50 files changed
+260
-405
No files matched your search
@@ -15,7 +15,7 @@ except ImportError:
|
||||
from core.cli import InputMissing, suggest_names
|
||||
from model.alternatives import derive_member_requirements
|
||||
from model.sources import source_yaml
|
||||
from model.systems import norm_system_id
|
||||
from model.systems import norm_system_id, system_index
|
||||
from core.paths import REPO_ROOT
|
||||
|
||||
|
||||
@@ -52,6 +52,17 @@ def profiles_for_systems(
|
||||
return matching
|
||||
|
||||
|
||||
def no_profile_for_systems(profiles: dict, system_ids: list[str], standalone: bool = False) -> str:
|
||||
"""Why profiles_for_systems found nothing, with the closest system ids."""
|
||||
kind = "standalone emulators" if standalone else "emulators"
|
||||
all_systems = sorted({sid for p in profiles.values() for sid in p.get("systems", [])})
|
||||
# --list-systems merges spellings that differ in case or separator:
|
||||
# the hint counted 579 spellings for the 532 lines it prints.
|
||||
hint = suggest_names(system_ids, all_systems, "--list-systems",
|
||||
listed=len(system_index(profiles)))
|
||||
return f"No {kind} found for system(s): {', '.join(system_ids)}\n{hint}"
|
||||
|
||||
|
||||
def entry_system_ids(entry: dict, profile: dict) -> list[str]:
|
||||
"""Systems a profile entry serves.
|
||||
|
||||
|
||||
Reference in new issue
Block a user