Improve type checks under check-untyped-defs
This commit is contained in:
@@ -446,7 +446,7 @@ class OcrGrafter:
|
||||
self.pdf_base.close()
|
||||
return self.output_file
|
||||
|
||||
def _parse_hocr_pages(self):
|
||||
def _parse_hocr_pages(self) -> list[Fpdf2ParsedPage]:
|
||||
"""Render all pages to multi-page PDF with shared fonts, then graft."""
|
||||
from ocrmypdf.hocrtransform.hocr_parser import HocrParser
|
||||
|
||||
|
||||
@@ -464,7 +464,7 @@ class OcrOptions(BaseModel):
|
||||
):
|
||||
raise ValueError(
|
||||
"Since you specified `--output-type none`, the output file "
|
||||
f"{self.output_file} cannot be produced. Set the output file to "
|
||||
f"{str(self.output_file)} cannot be produced. Set the output file to "
|
||||
f"`-` to suppress this message."
|
||||
)
|
||||
return self
|
||||
|
||||
@@ -21,7 +21,7 @@ class PluginOptionRegistry:
|
||||
compatibility (e.g., options.tesseract_timeout).
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
self._option_models: dict[str, type[BaseModel]] = {}
|
||||
|
||||
def register_option_model(
|
||||
|
||||
@@ -550,6 +550,8 @@ def main(): # pragma: no cover
|
||||
pprint(pdfinfo)
|
||||
for page in pdfinfo.pages:
|
||||
pprint(page)
|
||||
if page is None:
|
||||
continue
|
||||
for im in page.images:
|
||||
pprint(im)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user