Repository navigation
ttpf_mips: scan searches any pool folder and rejects a path with no pool - #1458
Conversation
|
Independent CPU verification, at head
|
|
Pushed a small follow-up commit ( |
|
Tested 6b28230 (0 behind main) on Windows 11 Home 10.0.26300 (ANSI code page 1252), Python 3.14.7, pytest 9.2.0.
The new test fails without the change, so it covers it. AI-assisted (Claude Code). Synthetic test inputs only, no game files. |
`scan` only looked for pools under <path>/data/ttdb and <path>/pack/*/data/ttdb, so pointing it at data/ttdb itself, one of its folders or pack/ found nothing, and a mistyped path did the same: it printed an all-zero summary and exited 0. A folder that holds no pool at those game-root places is now searched recursively for .ttpf, and a path that still yields no pool is an ERROR line naming it (no such file or folder / no .ttpf pool in it) with exit code 2. Real data (counts only), pools found on my 1.0.2.1 copy, main -> this change: game root 57 -> 57 (same list), pack/story000 3 -> 3 (same list), data/ttdb 0 -> 46, data/ttdb/peds 0 -> 9, pack 0 -> 11; a mistyped dat/ttdb now exits 2 instead of 0. Tests: test_scan_finds_pools_below_any_folder_and_rejects_paths_without_one (main: 0 pools for data/ttdb). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A folder name with glob characters, like "Game [v1]", was used as a glob pattern, so no pool matched and the new "no .ttpf pool in it" error would name a folder that does hold pools. The folder is now passed through glob.escape; only the parts below it are patterns. Test: test_scan_finds_pools_below_any_folder_and_rejects_paths_without_one now builds its game folder as "game [v1]" (without the escape: 0 pools). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Rebased onto main 99f9989 after #1410 (e8562e3), which added the |
207977f to
d835fac
Compare
BUILD-261.
What and why
scanonly looked for pools under<path>/data/ttdband<path>/pack/*/data/ttdb. Pointing it atdata/ttdbitself, one of its folders orpack/found nothing. A mistyped path did the same: an all-zero summary and exit 0.A folder that holds no pool at those game-root places is now searched recursively for
.ttpf. A path that still yields no pool gives anERRORline naming it (no such file or folder/no .ttpf pool in it) and exit code 2. This is a different problem from #1410, which stops a report path from overwriting an input; the two touch different lines.Proof
main-> this PR:pack/story000: 3 -> 3 (same list)data/ttdb: 0 -> 46data/ttdb/peds: 0 -> 9pack: 0 -> 11dat/ttdbnow exits 2 instead of 0.test_scan_finds_pools_below_any_folder_and_rejects_paths_without_one(onmain: 0 pools fordata/ttdb).tests/test_ttpf_mips.py: 50 passed.Windows 11 Pro 26200, Python 3.14, CPU only (no GPU path involved). No game data in the PR; real-data numbers are counts from my own 1.0.2.1 copy.
By @rafaelpssz, with Claude Code (AI-assisted).