mirror of
https://github.com/qurator-spk/dinglehopper.git
synced 2025-06-09 20:00:01 +02:00
🐛 Fix loading ocrd-tool.json for Python 3.12
This commit is contained in:
parent
bc5818da9f
commit
4047f8b6e5
2 changed files with 7 additions and 2 deletions
|
@ -11,3 +11,4 @@ multimethod >= 1.3
|
||||||
tqdm
|
tqdm
|
||||||
rapidfuzz >= 2.7.0
|
rapidfuzz >= 2.7.0
|
||||||
chardet
|
chardet
|
||||||
|
importlib_resources
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import importlib_resources
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
@ -5,11 +6,14 @@ import click
|
||||||
from ocrd import Processor
|
from ocrd import Processor
|
||||||
from ocrd.decorators import ocrd_cli_options, ocrd_cli_wrap_processor
|
from ocrd.decorators import ocrd_cli_options, ocrd_cli_wrap_processor
|
||||||
from ocrd_utils import assert_file_grp_cardinality, getLogger, make_file_id
|
from ocrd_utils import assert_file_grp_cardinality, getLogger, make_file_id
|
||||||
from pkg_resources import resource_string
|
|
||||||
|
|
||||||
from .cli import process as cli_process
|
from .cli import process as cli_process
|
||||||
|
|
||||||
OCRD_TOOL = json.loads(resource_string(__name__, "ocrd-tool.json").decode("utf8"))
|
OCRD_TOOL = json.loads(
|
||||||
|
importlib_resources.files(__name__)
|
||||||
|
.joinpath("ocrd-tool.json")
|
||||||
|
.read_text(encoding="utf-8", errors="strict")
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue