Fix directory resolution in layout, and generate the session READMEs

layout.path() treated every argument as a filename, so asking it for a
directory - layout.path('final'), which the rendering scripts do - built
a path to a file called 'final' INSIDE final/ and created an empty
final/final along the way. Directory names now resolve to the directory
itself.

Three scripts also held path literals split across two lines with
implicit string concatenation, where the rewrite had replaced only the
first fragment and left a dangling continuation. verify_core.py,
mo_gccheck.py and mo_mpc.py are corrected; all 52 files now compile
without warnings.

subdir_readmes.py writes a short README into each session subdirectory
saying what it holds, where it came from, and whether it is safe to
delete. Those three facts are what someone opening a folder cold needs,
and they belong with the data rather than in this repo.

Re-verified after the fix: closeup.py and triptych.py run end to end
against the reorganised session and leave no stray directories behind.
This commit is contained in:
laurence 2026-07-21 15:33:52 +01:00
parent 5286a2e81b
commit f2d173f047
2 changed files with 124 additions and 0 deletions

View file

@ -85,6 +85,13 @@ def path(*parts, make=True):
correctly. The last component is the one that decides.
"""
name = parts[-1]
if name in _DIRS:
# Asking for a directory by name returns the directory itself, not a
# file of that name nested inside it.
full = os.path.join(SESSION, _DIRS[name])
if make:
os.makedirs(full, exist_ok=True)
return full
full = os.path.join(SESSION, subdir(name), name)
if make:
os.makedirs(os.path.dirname(full), exist_ok=True)