Reverts unintentional change

This commit is contained in:
Trenton H 2023-12-28 12:37:04 -08:00
parent 4ec578f3b6
commit bb913af9d8
3 changed files with 4 additions and 15 deletions

View File

@ -79,7 +79,7 @@ class OcrConfig(OutputTypeConfig):
user_args = None user_args = None
if app_config.user_args: if app_config.user_args:
user_args = app_config.user_args user_args = app_config.user_args
elif settings.OCR_USER_ARGS is not None: elif settings.OCR_USER_ARGS is not None: # pragma: no cover
try: try:
user_args = json.loads(settings.OCR_USER_ARGS) user_args = json.loads(settings.OCR_USER_ARGS)
except json.JSONDecodeError: except json.JSONDecodeError:

View File

@ -50,15 +50,6 @@ def __get_boolean(key: str, default: str = "NO") -> bool:
return bool(os.getenv(key, default).lower() in ("yes", "y", "1", "t", "true")) return bool(os.getenv(key, default).lower() in ("yes", "y", "1", "t", "true"))
def __get_optional_boolean(key: str) -> Optional[bool]:
"""
Returns None if the environment key is not present, otherwise a boolean
"""
if key in os.environ:
return __get_boolean(key)
return None
def __get_int(key: str, default: int) -> int: def __get_int(key: str, default: int) -> int:
""" """
Return an integer value based on the environment variable or a default Return an integer value based on the environment variable or a default
@ -71,7 +62,7 @@ def __get_optional_int(key: str) -> Optional[int]:
Returns None if the environment key is not present, otherwise an integer Returns None if the environment key is not present, otherwise an integer
""" """
if key in os.environ: if key in os.environ:
return __get_int(key, -1) return __get_int(key, -1) # pragma: no cover
return None return None
@ -97,7 +88,7 @@ def __get_path(
def __get_optional_path(key: str) -> Optional[Path]: def __get_optional_path(key: str) -> Optional[Path]:
""" """
Returns None if the environment key is not present, otherwise an integer Returns None if the environment key is not present, otherwise a fully resolved Path
""" """
if key in os.environ: if key in os.environ:
return __get_path(key, "") return __get_path(key, "")

View File

@ -5,10 +5,8 @@ def get_parser(*args, **kwargs):
def tesseract_consumer_declaration(sender, **kwargs): def tesseract_consumer_declaration(sender, **kwargs):
from paperless_tesseract.parsers import RasterisedDocumentParser
return { return {
"parser": RasterisedDocumentParser, "parser": get_parser,
"weight": 0, "weight": 0,
"mime_types": { "mime_types": {
"application/pdf": ".pdf", "application/pdf": ".pdf",