mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-12-01 05:48:52 -06:00
refactor: read verify output by its command
This commit is contained in:
1 parent
35ad46e8c5
commit
75ccaf460c
4 files changed
+48
-32
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Sequence
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
@@ -35,3 +36,9 @@ class JobResult:
|
||||
returncode: int
|
||||
duration: float
|
||||
tail: str # last non-empty line of stderr or stdout
|
||||
# (command, what it printed) for each command that ran, in order.
|
||||
outputs: tuple[tuple[tuple[str, ...], str], ...] = ()
|
||||
|
||||
def output_of(self, command: Sequence[str]) -> str:
|
||||
"""What *command* printed in this job, empty when it did not run."""
|
||||
return next((text for ran, text in self.outputs if ran == tuple(command)), "")
|
||||
Reference in new issue
Block a user