Workflow: sparse partial checkout (code and _incoming only), book lookup before processing, safe rebase retry; revert cancel-in-progress

This commit is contained in:
Audiobook Producer
2026-10-18 01:48:48 -05:00
parent 517e76c533
commit 153153010e
6 changed files with 77 additions and 18 deletions
+3 -2
View File
@@ -85,11 +85,12 @@ def align(raw_lines, boxes, window=8):
return result
def units(pdf):
def units(pdf, first_pages=None):
"""Reading units in order: [{'pdf_page', 'half', 'text', 'geom'}]. Text keeps the layout (indentation, hyphens).
'geom' is parallel to text.split('\\n'): the position of each line on the page (see align)."""
result = []
for p, (w, h) in enumerate(page_geometry(pdf), start=1):
geo = page_geometry(pdf)
for p, (w, h) in enumerate(geo[:first_pages] if first_pages else geo, start=1):
boxes = page_lines(pdf, p)
for half, x, width in halves(w, h):
text = _run(["pdftotext", "-layout", "-f", str(p), "-l", str(p),