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
|
||||
rapidfuzz >= 2.7.0
|
||||
chardet
|
||||
importlib_resources
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import importlib_resources
|
||||
import json
|
||||
import os
|
||||
|
||||
|
@ -5,11 +6,14 @@ import click
|
|||
from ocrd import 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 pkg_resources import resource_string
|
||||
|
||||
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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue