Files
libretro/tests/launcherssupport.py
T
Abdessamad Derraz e1bad01b82 refactor: group scraper modules by subject
scraper/ held the platform scrapers next to three other subjects. The
launcher readers move to scraper/launchers/ (their _launchers suffix
dropped), the MAME and FBNeo hash scrapers and romset importers to
scraper/arcade/, the DAT readers and dump catalog importers to
scraper/dats/. The buildbot check is a freshness check and moves to
freshness/buildbot.py. Every -m command, workflow job, schema
description and page follows.

The scraper discovery in scraper/__init__.py had no caller: the
registry's scraper: field names the module, and the pages now say so.
2026-11-24 10:22:26 +01:00

27 lines
804 B
Python

"""Source texts the launcher test modules build: blocks placed at their lines, C# files by path."""
from __future__ import annotations
import tests
import textwrap
from scraper.launchers.csharp_source import Source
def placed(blocks: dict[int, str]) -> str:
"""Each block starting at its line, blank lines between."""
lines: list[str] = []
for start, block in sorted(blocks.items()):
if len(lines) >= start:
raise AssertionError(f"block at line {start} overlaps the previous one")
lines += [""] * (start - 1 - len(lines))
lines += block.splitlines()
return "\n".join(lines) + "\n"
def _sources(**texts: str) -> dict[str, Source]:
return {
path: Source(path, textwrap.dedent(text).lstrip("\n")) for path, text in texts.items()
}