Reverts unintentional change
This commit is contained in:
parent
4ec578f3b6
commit
bb913af9d8
@ -79,7 +79,7 @@ class OcrConfig(OutputTypeConfig):
|
||||
user_args = None
|
||||
if 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:
|
||||
user_args = json.loads(settings.OCR_USER_ARGS)
|
||||
except json.JSONDecodeError:
|
||||
|
@ -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"))
|
||||
|
||||
|
||||
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:
|
||||
"""
|
||||
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
|
||||
"""
|
||||
if key in os.environ:
|
||||
return __get_int(key, -1)
|
||||
return __get_int(key, -1) # pragma: no cover
|
||||
return None
|
||||
|
||||
|
||||
@ -97,7 +88,7 @@ def __get_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:
|
||||
return __get_path(key, "")
|
||||
|
@ -5,10 +5,8 @@ def get_parser(*args, **kwargs):
|
||||
|
||||
|
||||
def tesseract_consumer_declaration(sender, **kwargs):
|
||||
from paperless_tesseract.parsers import RasterisedDocumentParser
|
||||
|
||||
return {
|
||||
"parser": RasterisedDocumentParser,
|
||||
"parser": get_parser,
|
||||
"weight": 0,
|
||||
"mime_types": {
|
||||
"application/pdf": ".pdf",
|
||||
|
Loading…
x
Reference in New Issue
Block a user