Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ocrd_cli_wrap_processor: drop passing ocrd_tool=None #998

@bertsky

Description

@bertsky

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:

ocrd_tool=None,

It does nothing but pass it on to run_processor:

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):

ocrd_tool=None,

So it gets passed onto the processor constructor:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions