Fix some errors found in calc examples

This commit is contained in:
Timothyxxx
2024-01-28 21:19:18 +08:00
parent 353ab6607d
commit cc21c3a6b1
9 changed files with 186 additions and 125 deletions

View File

@@ -6,6 +6,8 @@ from pypdf import PdfReader
def check_pdf_pages(pdf_file: str, rules: Dict[str, Any]) -> float:
if pdf_file is None:
return 0.0
reader = PdfReader(pdf_file)
nb_pages: int = len(reader.pages)
return float(getattr(operator, rules["relation"])(nb_pages, rules["ref_value"]))