Skip to content

Commit

Permalink
expose ocrd-tool.json for ocrd-dummy in root like processors
Browse files Browse the repository at this point in the history
  • Loading branch information
kba committed Jan 19, 2024
1 parent e943eda commit de11f8f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
1 change: 1 addition & 0 deletions ocrd-tool.json
26 changes: 15 additions & 11 deletions ocrd/ocrd/processor/builtin/dummy/ocrd-tool.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{
"executable": "ocrd-dummy",
"description": "Bare-bones processor creates PAGE-XML and optionally copies file from input group to output group",
"steps": ["preprocessing/optimization"],
"categories": ["Image preprocessing"],
"input_file_grp": "DUMMY_INPUT",
"output_file_grp": "DUMMY_OUTPUT",
"parameters": {
"copy_files": {
"type": "boolean",
"default": false,
"description": "Whether to actually copy files (true) or just create PAGE-XML as a side effect (false)"
"tools": {
"ocrd-dummy": {
"executable": "ocrd-dummy",
"description": "Bare-bones processor creates PAGE-XML and optionally copies file from input group to output group",
"steps": ["preprocessing/optimization"],
"categories": ["Image preprocessing"],
"input_file_grp": "DUMMY_INPUT",
"output_file_grp": "DUMMY_OUTPUT",
"parameters": {
"copy_files": {
"type": "boolean",
"default": false,
"description": "Whether to actually copy files (true) or just create PAGE-XML as a side effect (false)"
}
}
}
}
}
2 changes: 1 addition & 1 deletion ocrd/ocrd/processor/builtin/dummy_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def process(self):


def __init__(self, *args, **kwargs):
kwargs['ocrd_tool'] = OCRD_TOOL
kwargs['ocrd_tool'] = OCRD_TOOL['tools']['ocrd-dummy']
kwargs['version'] = '0.0.3'
super(DummyProcessor, self).__init__(*args, **kwargs)

Expand Down
5 changes: 2 additions & 3 deletions tests/cli/test_bashlib.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from tests.base import CapturingTestCase as TestCase, main, assets, copy_of_directory

from pkg_resources import parse_version
import os, sys
import traceback
import subprocess
Expand Down Expand Up @@ -103,8 +102,8 @@ def test_bashlib_minversion(self):
exit_code, out, err = self.invoke_bash(
"source $(ocrd bashlib filename) && ocrd__minversion 2.29.0")
assert exit_code == 0
version = parse_version(VERSION)
version = "%d.%d.%d" % (version.major, version.minor+1, 0)
major, minor = map(int, VERSION.split('.')[0:2])
version = "%d.%d.%d" % (major, minor + 1, 0)
exit_code, out, err = self.invoke_bash(
"source $(ocrd bashlib filename) && ocrd__minversion " + version)
assert exit_code > 0
Expand Down

0 comments on commit de11f8f

Please sign in to comment.