v0.6.0 BigUpdate
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from ..word_fix import FixResult, fix_continuations
|
||||
from .detect import DEFAULT_OFFICE_ENGINE, resolve_office_engine
|
||||
from .detect import DEFAULT_OFFICE_ENGINE, OfficeInstall, resolve_office_engine
|
||||
from .uno_fix import fix_continuations_uno
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ def fix_continuations_with_engine(
|
||||
path: str,
|
||||
*,
|
||||
engine: str = DEFAULT_OFFICE_ENGINE,
|
||||
install: OfficeInstall | None = None,
|
||||
tables: bool = True,
|
||||
listings: bool = True,
|
||||
repeat_header: bool = False,
|
||||
@@ -18,10 +19,15 @@ def fix_continuations_with_engine(
|
||||
"""
|
||||
Split cross-page tables/listings using the selected office engine.
|
||||
|
||||
``engine`` is ``auto|word|libre|openoffice``. On missing backend returns
|
||||
``ok=False`` with a reason; conversion should continue.
|
||||
``engine`` is ``auto|word|libre|openoffice``. Pass a concrete ``engine`` plus
|
||||
``install`` from ``resolve_office_engine`` to skip a second resolve. On
|
||||
missing backend returns ``ok=False`` with a reason; conversion should
|
||||
continue.
|
||||
"""
|
||||
resolved, install = resolve_office_engine(engine)
|
||||
if install is not None and engine in ("word", "libre", "openoffice"):
|
||||
resolved = engine
|
||||
else:
|
||||
resolved, install = resolve_office_engine(engine)
|
||||
if resolved is None or install is None:
|
||||
if engine == "auto":
|
||||
return FixResult(
|
||||
|
||||
Reference in New Issue
Block a user