Additional ruff fixes

This commit is contained in:
James R. Barlow
2023-04-14 01:25:16 -07:00
parent 1d0e4e7c9f
commit 4924b11b6b
21 changed files with 113 additions and 22 deletions
+2
View File
@@ -3,6 +3,8 @@
# SPDX-FileCopyrightText: 2020 James R Barlow <https://github.com/jbarlow83>
# SPDX-License-Identifier: MIT
"""Watch a directory for new PDFs and OCR them."""
from __future__ import annotations
import json
+1 -1
View File
@@ -48,7 +48,7 @@ def do_ocrmypdf(file):
return Response("--sidecar not supported", 501, mimetype='text/plain')
ocrmypdf_args = ["ocrmypdf", *cmd_args, up_file, down_file]
proc = run(ocrmypdf_args, capture_output=True, encoding="utf-8")
proc = run(ocrmypdf_args, capture_output=True, encoding="utf-8", check=False)
if proc.returncode != 0:
stderr = proc.stderr
return Response(stderr, 400, mimetype='text/plain')