mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-23 10:07:48 -06:00
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.
20 lines
608 B
Python
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
|