ocrd 3.0.0b3__py3-none-any.whl → 3.0.0b4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ocrd/processor/base.py +16 -13
- ocrd/workspace.py +4 -1
- {ocrd-3.0.0b3.dist-info → ocrd-3.0.0b4.dist-info}/METADATA +1 -1
- {ocrd-3.0.0b3.dist-info → ocrd-3.0.0b4.dist-info}/RECORD +8 -8
- {ocrd-3.0.0b3.dist-info → ocrd-3.0.0b4.dist-info}/LICENSE +0 -0
- {ocrd-3.0.0b3.dist-info → ocrd-3.0.0b4.dist-info}/WHEEL +0 -0
- {ocrd-3.0.0b3.dist-info → ocrd-3.0.0b4.dist-info}/entry_points.txt +0 -0
- {ocrd-3.0.0b3.dist-info → ocrd-3.0.0b4.dist-info}/top_level.txt +0 -0
ocrd/processor/base.py
CHANGED
|
@@ -166,11 +166,14 @@ class Processor():
|
|
|
166
166
|
|
|
167
167
|
(Override if ``ocrd-tool.json`` is not distributed with the Python package.)
|
|
168
168
|
"""
|
|
169
|
-
|
|
170
|
-
module_tokens =
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
169
|
+
module = inspect.getmodule(self)
|
|
170
|
+
module_tokens = module.__package__.split('.')
|
|
171
|
+
# for namespace packages, we cannot just use the first token
|
|
172
|
+
for i in range(len(module_tokens)):
|
|
173
|
+
prefix = '.'.join(module_tokens[:i + 1])
|
|
174
|
+
if sys.modules[prefix].__spec__.has_location:
|
|
175
|
+
return resource_filename(prefix, self.metadata_filename)
|
|
176
|
+
raise Exception("cannot find top-level module prefix for %s", module.__package__)
|
|
174
177
|
|
|
175
178
|
@cached_property
|
|
176
179
|
def metadata_rawdict(self) -> dict:
|
|
@@ -455,17 +458,17 @@ class Processor():
|
|
|
455
458
|
nr_copied = 0
|
|
456
459
|
|
|
457
460
|
# set up multithreading
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
max_workers =
|
|
461
|
+
max_workers = max(0, config.OCRD_MAX_PARALLEL_PAGES)
|
|
462
|
+
if self.max_workers > 0 and self.max_workers < config.OCRD_MAX_PARALLEL_PAGES:
|
|
463
|
+
self._base_logger.info("limiting number of threads from %d to %d", max_workers, self.max_workers)
|
|
464
|
+
max_workers = self.max_workers
|
|
462
465
|
if max_workers > 1:
|
|
463
466
|
assert isinstance(workspace.mets, ClientSideOcrdMets), \
|
|
464
467
|
"OCRD_MAX_PARALLEL_PAGES>1 requires also using --mets-server-url"
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
max_seconds =
|
|
468
|
+
max_seconds = max(0, config.OCRD_PROCESSING_PAGE_TIMEOUT)
|
|
469
|
+
if self.max_page_seconds > 0 and self.max_page_seconds < config.OCRD_PROCESSING_PAGE_TIMEOUT:
|
|
470
|
+
self._base_logger.info("limiting page timeout from %d to %d sec", max_seconds, self.max_page_seconds)
|
|
471
|
+
max_seconds = self.max_page_seconds
|
|
469
472
|
executor = ThreadPoolExecutor(
|
|
470
473
|
max_workers=max_workers or 1,
|
|
471
474
|
thread_name_prefix=f"pagetask.{workspace.mets.unique_identifier}"
|
ocrd/workspace.py
CHANGED
|
@@ -121,7 +121,10 @@ class Workspace():
|
|
|
121
121
|
"""
|
|
122
122
|
Reload METS from the filesystem.
|
|
123
123
|
"""
|
|
124
|
-
|
|
124
|
+
if self.is_remote:
|
|
125
|
+
self.mets.reload()
|
|
126
|
+
else:
|
|
127
|
+
self.mets = OcrdMets(filename=self.mets_target)
|
|
125
128
|
|
|
126
129
|
@deprecated_alias(pageId="page_id")
|
|
127
130
|
@deprecated_alias(ID="file_id")
|
|
@@ -7,7 +7,7 @@ ocrd/resolver.py,sha256=Ba9ALQbTXz6_mla4VqN9tAfHoj6aKuNJAU4tIDnjcHE,14952
|
|
|
7
7
|
ocrd/resource_list.yml,sha256=82-PiqkZnka1kTj3MQqNn4wXWKHHtoFchsQuetWuqFs,2633
|
|
8
8
|
ocrd/resource_manager.py,sha256=8BMVKJq8J56hugi8vtGn9Ffuk7oRkbs197aG74aKbCY,16733
|
|
9
9
|
ocrd/task_sequence.py,sha256=spiaUQaMM7M8WdBDoQGmLuTPm7tOugYXD6rcJ2UXzxw,6991
|
|
10
|
-
ocrd/workspace.py,sha256=
|
|
10
|
+
ocrd/workspace.py,sha256=V-7w3mRc0l8XmUOpdbsUPE2BfqWS8K8106pQPrDHbN4,65684
|
|
11
11
|
ocrd/workspace_backup.py,sha256=iab_JjZ_mMP-G8NIUk4PZmfpNlQuGRoqc3NbTSSew1w,3621
|
|
12
12
|
ocrd/workspace_bagger.py,sha256=yU8H3xR5WmQKvgQewac71ie-DUWcfLnMS01D55zsEHQ,11971
|
|
13
13
|
ocrd/cli/__init__.py,sha256=lNR6wMf7JhQ8Jf33tUkowJr0mB3423OMY0_6dkMRLvU,2672
|
|
@@ -26,7 +26,7 @@ ocrd/decorators/mets_find_options.py,sha256=d4oATKMP6bFQHNqOK6nLqgUiWF2FYdkPvzkT
|
|
|
26
26
|
ocrd/decorators/ocrd_cli_options.py,sha256=4pcBLAFPSpYZLj6r9Yj1GZOQl4r_RWU00pyA4mHwFQk,2621
|
|
27
27
|
ocrd/decorators/parameter_option.py,sha256=n8hYw7XVTd3i3tvpK8F1Jx_CqRp6EGF9qJVH95yj92Q,1076
|
|
28
28
|
ocrd/processor/__init__.py,sha256=39ymNwYRdc-b_OJzzKmWCvo2ga3KdsGSYDHE1Hzkn_w,274
|
|
29
|
-
ocrd/processor/base.py,sha256=
|
|
29
|
+
ocrd/processor/base.py,sha256=Q3dJn_I7iXi9wNKzbIsHp3LQ8_qp5yqu5CGJ8z17Xgc,49318
|
|
30
30
|
ocrd/processor/helpers.py,sha256=Lp9zbHYCLpT3GnPzl-p7UCSFU5Nx99gYEYXwW04v0RI,10157
|
|
31
31
|
ocrd/processor/ocrd_page_result.py,sha256=AazEmnWyPEN47TxXVg0WUQpgFNV_mlIiExwwycUj0nQ,490
|
|
32
32
|
ocrd/processor/builtin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -118,9 +118,9 @@ ocrd_validators/xlink.xsd,sha256=8fW7YAMWXN2PbB_MMvj9H5ZeFoEBDzuYBtlGC8_6ijw,318
|
|
|
118
118
|
ocrd_validators/xsd_mets_validator.py,sha256=4GWfLyqkmca0x7osDuXuExYuM0HWVrKoqn0S35sFhHU,467
|
|
119
119
|
ocrd_validators/xsd_page_validator.py,sha256=BNz_9u-Ek4UCeyZu3KxSQoolfW9lvuaSR9nIu1XXxeE,467
|
|
120
120
|
ocrd_validators/xsd_validator.py,sha256=6HrVAf6SzCvfUIuQdIzz9bOq4V-zhyii9yrUPoK2Uvo,2094
|
|
121
|
-
ocrd-3.0.
|
|
122
|
-
ocrd-3.0.
|
|
123
|
-
ocrd-3.0.
|
|
124
|
-
ocrd-3.0.
|
|
125
|
-
ocrd-3.0.
|
|
126
|
-
ocrd-3.0.
|
|
121
|
+
ocrd-3.0.0b4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
122
|
+
ocrd-3.0.0b4.dist-info/METADATA,sha256=akkVQvrp5FNEvuD1FsH9mxW9SmpYRR3ZyeTns1jCja8,10397
|
|
123
|
+
ocrd-3.0.0b4.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
|
|
124
|
+
ocrd-3.0.0b4.dist-info/entry_points.txt,sha256=tV_gAdO8cbnOjS0GmKfJKbN60xBAV2DQRX6hEjleSjE,94
|
|
125
|
+
ocrd-3.0.0b4.dist-info/top_level.txt,sha256=pUgiN42t4KXC5rvpi6V8atza31XP4SCznXpXlVlvomM,75
|
|
126
|
+
ocrd-3.0.0b4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|