feat: recognise a mister card on a computer

This commit is contained in:
Abdessamad Derraz committed 2026-11-05 19:25:30 +01:00
1 parent 66dae2a974
commit 73b82375d9
19 files changed
+72 -34

No files matched your search

+6 -2
View File
@@ -175,6 +175,10 @@ def route_keys() -> str:
return _table(heading, rows)
# Card markers that are files with no extension: the MiSTer binary.
_BARE_FILES = frozenset({"MiSTer"})
def _marker(rule: _install._OsRule) -> str:
"""A card rule's evidence in words: the file or folder, and the line it
holds for a rule that reads one."""
@@ -182,8 +186,8 @@ def _marker(rule: _install._OsRule) -> str:
path, pattern = rule.values
line = re.sub(r"\\s\*\$$", "", re.sub(r"^(\^|\\A)", "", pattern)).replace("\\", "")
return f"`{path}` holding the line `{line}`"
named = ", ".join(f"`{value}`" if PurePosixPath(value).suffix else f"`{value}/`"
for value in rule.values)
named = ", ".join(f"`{value}`" if PurePosixPath(value).suffix or value in _BARE_FILES
else f"`{value}/`" for value in rule.values)
if rule.method == "games_part":
# Told on the games part beside its bios folder, on a drive the
# system does not call fixed (install.games_part).