mirror of
https://github.com/allenai/olmocr.git
synced 2025-08-19 06:12:23 +00:00
Checkfix
This commit is contained in:
parent
9f010e6ab0
commit
5ebc8cdd88
@ -7,12 +7,15 @@ logger = logging.getLogger(__name__)
|
|||||||
def check_poppler_version():
|
def check_poppler_version():
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(['pdftoppm', '-h'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
result = subprocess.run(['pdftoppm', '-h'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
||||||
if result.returncode == 0 and "pdftoppm" in result.stdout:
|
if result.returncode == 0 and result.stderr.startswith("pdftoppm"):
|
||||||
logger.info("pdftoppm is installed and working.")
|
logger.info("pdftoppm is installed and working.")
|
||||||
else:
|
else:
|
||||||
logger.error("pdftoppm is installed but returned an error.")
|
logger.error(f"pdftoppm is installed but returned an error.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
logger.error("pdftoppm is not installed.")
|
logger.error("pdftoppm is not installed.")
|
||||||
logger.error("Check the README in the https://github.com/allenai/pdelfin/blob/main/README.md for installation instructions")
|
logger.error("Check the README in the https://github.com/allenai/pdelfin/blob/main/README.md for installation instructions")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
check_poppler_version()
|
Loading…
x
Reference in New Issue
Block a user