diff --git a/src/ocrmypdf/__init__.py b/src/ocrmypdf/__init__.py index 5f017798..5905aa58 100644 --- a/src/ocrmypdf/__init__.py +++ b/src/ocrmypdf/__init__.py @@ -10,6 +10,9 @@ from pluggy import HookimplMarker as _HookimplMarker from ocrmypdf import helpers, hocrtransform, pdfa, pdfinfo from ocrmypdf._concurrent import Executor from ocrmypdf._jobcontext import PageContext, PdfContext +from ocrmypdf._pipelines._common import ( + configure_debug_logging, +) from ocrmypdf._version import PROGRAM_NAME, __version__ from ocrmypdf.api import Verbosity, configure_logging, hocr_to_ocr_pdf, ocr, pdf_to_hocr from ocrmypdf.exceptions import ( @@ -30,9 +33,11 @@ from ocrmypdf.pluginspec import OcrEngine, OrientationConfidence hookimpl = _HookimplMarker('ocrmypdf') + __all__ = [ '__version__', 'BadArgsError', + 'configure_debug_logging', 'configure_logging', 'DpiError', 'EncryptedPdfError', diff --git a/src/ocrmypdf/__main__.py b/src/ocrmypdf/__main__.py index 68aebdef..cec02d13 100755 --- a/src/ocrmypdf/__main__.py +++ b/src/ocrmypdf/__main__.py @@ -14,8 +14,8 @@ import sys from contextlib import suppress from ocrmypdf import __version__ +from ocrmypdf._pipelines.ocr import run_pipeline_cli from ocrmypdf._plugin_manager import get_parser_options_plugins -from ocrmypdf._sync import run_pipeline_cli from ocrmypdf._validation import check_options from ocrmypdf.api import Verbosity, configure_logging from ocrmypdf.exceptions import ( diff --git a/src/ocrmypdf/_sync.py b/src/ocrmypdf/_sync.py deleted file mode 100644 index 24eb9fd2..00000000 --- a/src/ocrmypdf/_sync.py +++ /dev/null @@ -1,27 +0,0 @@ -# SPDX-FileCopyrightText: 2019-2022 James R. Barlow -# SPDX-FileCopyrightText: 2019 Martin Wind -# SPDX-License-Identifier: MPL-2.0 - -"""Implements the concurrent and page synchronous parts of the pipeline.""" - - -from __future__ import annotations - -import logging -import logging.handlers - -from ocrmypdf._pipelines._common import ( - configure_debug_logging, -) -from ocrmypdf._pipelines.ocr import run_pipeline, run_pipeline_cli -from ocrmypdf._pipelines.pdf_to_hocr import run_hocr_pipeline - -log = logging.getLogger(__name__) - - -__all__ = [ - 'run_pipeline', - 'run_pipeline_cli', - 'run_hocr_pipeline', - 'configure_debug_logging', -] diff --git a/src/ocrmypdf/api.py b/src/ocrmypdf/api.py index eb5096b0..98e22f68 100644 --- a/src/ocrmypdf/api.py +++ b/src/ocrmypdf/api.py @@ -21,8 +21,9 @@ import pluggy from ocrmypdf._logging import PageNumberFilter from ocrmypdf._pipelines.hocr_to_ocr_pdf import run_hocr_to_ocr_pdf_pipeline +from ocrmypdf._pipelines.ocr import run_pipeline, run_pipeline_cli +from ocrmypdf._pipelines.pdf_to_hocr import run_hocr_pipeline from ocrmypdf._plugin_manager import get_plugin_manager -from ocrmypdf._sync import run_hocr_pipeline, run_pipeline, run_pipeline_cli from ocrmypdf._validation import check_options from ocrmypdf.cli import ArgumentParser, get_parser from ocrmypdf.helpers import is_iterable_notstr diff --git a/tests/test_logging.py b/tests/test_logging.py index 896d1810..e4b31ff0 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -5,7 +5,7 @@ from __future__ import annotations import logging -from ocrmypdf._sync import configure_debug_logging +from ocrmypdf._pipelines._common import configure_debug_logging def test_debug_logging(tmp_path):