-
Notifications
You must be signed in to change notification settings - Fork 33
Description
We seem to have a bug from very early on that never surfaced:
Obviously, nowhere in the CLI params there is a setting for the ocrd_tool.
However, our Processor decorator ocrd_cli_wrap_processor does take such a kwarg:
core/ocrd/ocrd/decorators/__init__.py
Line 26 in 5512569
| ocrd_tool=None, |
It does nothing but pass it on to run_processor:
core/ocrd/ocrd/decorators/__init__.py
Line 117 in 5512569
| run_processor(processorClass, ocrd_tool, mets, workspace=workspace, **kwargs) |
In that context, ocrd_tool could be meaningful (e.g. when running a processor from API):
core/ocrd/ocrd/processor/helpers.py
Line 38 in 5512569
| ocrd_tool=None, |
So it gets passed onto the processor constructor:
core/ocrd/ocrd/processor/helpers.py
Lines 87 to 91 in 5512569
| processor = get_processor( | |
| processor_class=processorClass, | |
| parameter=parameter, | |
| workspace=workspace, | |
| ocrd_tool=ocrd_tool, |
Still, this is not usually a problem, because all of our Processor subclasses simply override that kwarg.
But what if they just default to their own value?
IMO the top-level ocrd_tool param is wrong must be removed.