Download tasks/t07-remake-reference/environment/preflight.py from refreshdotdev/Refresh-GUI-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.36 kB
-
https://huggingface.co/datasets/refreshdotdev/Refresh-GUI-dataset/resolve/main/tasks/t07-remake-reference/environment/preflight.py
- Command line
-
hf download hf://datasets/refreshdotdev/Refresh-GUI-dataset/tasks/t07-remake-reference/environment/preflight.py
-
curl -L -o preflight.py https://huggingface.co/datasets/refreshdotdev/Refresh-GUI-dataset/resolve/main/tasks/t07-remake-reference/environment/preflight.py
1.36 kB
| """Check runtime capabilities without answer identities or grading data.""" | |
| import json | |
| from pathlib import Path | |
| import shutil | |
| import subprocess | |
| checks = {} | |
| for tool in ["shotcut", "ffmpeg", "ffprobe", "python3", "mousepad", "xterm", | |
| "Xvfb", "startxfce4", "chromium", "xdotool", "wmctrl", "tesseract"]: | |
| checks[f"tool:{tool}"] = shutil.which(tool) is not None | |
| clips = sorted(Path("/root/media").glob("*.MOV")) | |
| checks["media_count"] = len(clips) == 4 | |
| for path in [*clips, Path("/root/Desktop/reference.mp4")]: | |
| result = subprocess.run(["ffmpeg", "-v", "error", "-i", str(path), | |
| "-map", "0:v:0", "-map", "0:a:0", "-t", "1", | |
| "-f", "null", "-"], capture_output=True, timeout=30) | |
| checks[f"decode:{path.name}"] = result.returncode == 0 | |
| for directory in ["/root/Desktop", "/root/edit"]: | |
| probe = Path(directory) / ".write-probe.md" | |
| probe.write_text("write probe\n") | |
| checks[f"write:{directory}"] = probe.read_text() == "write probe\n" | |
| probe.unlink() | |
| checks["answer_paths_absent"] = all(not Path(p).exists() for p in | |
| ["/tests", "/solution", "/tmp/reference.mov", "/tmp/reference_full.mov", | |
| "/root/reference", "/root/edl.json"]) | |
| print(json.dumps({"passed": all(checks.values()), "checks": checks}, indent=2)) | |
| raise SystemExit(0 if all(checks.values()) else 1) | |