mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-23 20:29:06 -05:00
fix: label every platform that pulls all libretro
The cross-reference page read the label from the shape of cores:, so RetroPie and RetroDECK, which name retroarch in a list, showed no "(all libretro)". The label now comes from the resolved core set.
This commit is contained in:
1 parent
fe652bf508
commit
ddfac4a059
2 files changed
+44
-5
No files matched your search
@@ -4038,6 +4038,24 @@ def generate_gap_analysis(
|
||||
|
||||
|
||||
|
||||
def _core_scope_note(config: dict, profiles: dict) -> str:
|
||||
"""" (all libretro)" when the platform resolves every libretro core.
|
||||
|
||||
Read from what resolve_platform_cores returns, not from the shape of
|
||||
``cores:``: RetroPie and RetroDECK name ``retroarch`` in a list, which
|
||||
pulls in every libretro core as ``all_libretro`` does, and the label
|
||||
showed for RetroArch and Lakka only.
|
||||
"""
|
||||
every_libretro = resolve_platform_cores({"cores": "all_libretro"}, profiles)
|
||||
resolved = resolve_platform_cores(config, profiles)
|
||||
if not every_libretro or not every_libretro <= resolved:
|
||||
return ""
|
||||
others = len(resolved - every_libretro)
|
||||
if not others:
|
||||
return " (all libretro)"
|
||||
return f" (all libretro, plus {_count(others, 'other core')})"
|
||||
|
||||
|
||||
def _render_xref_by_platform(
|
||||
coverages: dict, unique: dict
|
||||
) -> list[str]:
|
||||
@@ -4047,7 +4065,6 @@ def _render_xref_by_platform(
|
||||
cov = coverages[pname]
|
||||
display = cov["platform"]
|
||||
config = cov["config"]
|
||||
platform_cores = config.get("cores", [])
|
||||
|
||||
lines.append(f'??? abstract "{display}"')
|
||||
lines.append("")
|
||||
@@ -4066,10 +4083,7 @@ def _render_xref_by_platform(
|
||||
if key in unique
|
||||
}
|
||||
|
||||
if platform_cores == "all_libretro":
|
||||
lines.append(f" **{len(matched)} cores** (all libretro)")
|
||||
else:
|
||||
lines.append(f" **{len(matched)} cores**")
|
||||
lines.append(f" **{len(matched)} cores**{_core_scope_note(config, unique)}")
|
||||
lines.append("")
|
||||
|
||||
lines.append(" | Core | Classification | Systems | Files | Upstream |")
|
||||
|
||||
@@ -44,5 +44,30 @@ class SiteCoreCounts(unittest.TestCase):
|
||||
self.assertEqual(shown[cov["platform"]], expected)
|
||||
|
||||
|
||||
class AllLibretroLabel(unittest.TestCase):
|
||||
"""RetroPie and RetroDECK pull in every libretro core by naming retroarch
|
||||
in a list, and the label read "(all libretro)" for RetroArch and Lakka
|
||||
only, the two whose cores: is the string."""
|
||||
|
||||
PROFILES = {
|
||||
"a": {"type": "libretro"},
|
||||
"b": {"type": "standalone + libretro"},
|
||||
"sa": {"type": "standalone"},
|
||||
}
|
||||
|
||||
def test_a_list_naming_retroarch_is_labelled(self):
|
||||
note = generate_site._core_scope_note(
|
||||
{"cores": ["retroarch", "sa"]}, self.PROFILES)
|
||||
self.assertEqual(note, " (all libretro, plus 1 other core)")
|
||||
|
||||
def test_the_string_form_is_labelled(self):
|
||||
note = generate_site._core_scope_note({"cores": "all_libretro"}, self.PROFILES)
|
||||
self.assertEqual(note, " (all libretro)")
|
||||
|
||||
def test_a_selection_is_not(self):
|
||||
self.assertEqual(
|
||||
generate_site._core_scope_note({"cores": ["a", "sa"]}, self.PROFILES), "")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user