Files
libretro/scripts/packs/runscope.py
T
Abdessamad Derraz 6aca93231a fix: let the run print what the scope leaves out
without_profile_blind and platforms_with_systems printed and exited from
the resolve layer. Under verify --all --region --json the left-out notice
went to stdout ahead of the document, which no longer parsed. Both now
return a RunScope, and packs/runscope.py prints the notices where the
command asks (stderr under --json) and ends a refused run with exit 1.
2026-11-21 16:43:46 +01:00

20 lines
608 B
Python

"""The platforms a run keeps, its notices printed and a refusal ending it."""
from __future__ import annotations
import sys
from typing import TextIO
from resolve.cores import RunScope
def settle_scope(scope: RunScope, notices_to: TextIO) -> list[str]:
"""Print the scope's notices on `notices_to` and return the platforms it
keeps. A refused scope prints its reason on stderr and exits 1."""
for line in scope.notices:
print(line, file=notices_to)
if scope.refusal is not None:
print(f"ERROR: {scope.refusal}", file=sys.stderr)
sys.exit(1)
return scope.kept