删掉回放的五个转发、重复的空格快捷键与重复的等待循环。
回放调用点直接走 replay_ctl,场景工具的路径引导收敛到 _paths,panel_snapshot 复用 panel_check 的 _wait_for,report_from 收成模块私有的 _report_from。
This commit is contained in:
@@ -26,20 +26,18 @@ import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
# Tests load this tool by file location, so add our own directory to the path.
|
||||
if str(Path(__file__).resolve().parent) not in sys.path:
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
||||
|
||||
from _paths import bootstrap_paths # noqa: E402
|
||||
|
||||
#: Exit codes: distinct values so a CI script can tell the two failures apart.
|
||||
EXIT_OK = 0
|
||||
EXIT_SOFTWARE = 3
|
||||
EXIT_NO_CONTEXT = 4
|
||||
|
||||
|
||||
def _bootstrap_paths() -> None:
|
||||
here = Path(__file__).resolve()
|
||||
repo = here.parents[2]
|
||||
for path in (repo / "apps" / "studio" / "src", repo / "shared" / "src"):
|
||||
if path.is_dir() and str(path) not in sys.path:
|
||||
sys.path.insert(0, str(path))
|
||||
|
||||
|
||||
def collect(profile: str, *, keep_open_s: float) -> dict:
|
||||
"""Create a real window, let Qt initialise it, and report what it got."""
|
||||
from orisys_studio.scene3d.gl_backend import (
|
||||
@@ -189,7 +187,7 @@ def main(argv: list[str] | None = None) -> int:
|
||||
)
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
_bootstrap_paths()
|
||||
bootstrap_paths()
|
||||
report = collect(args.profile, keep_open_s=0.6 if args.windowed else 0.3)
|
||||
context = report.get("context")
|
||||
if not context or not context.get("valid"):
|
||||
|
||||
Reference in New Issue
Block a user