allow overriding working dir from cli wrapper
@@ -5,13 +5,13 @@ import click
from ocrd.resolver import Resolver
from ocrd.processor.base import run_processor
-def ocrd_cli_wrap_processor(processorClass, mets_url=None, cache_enabled=True, *args, **kwargs):
+def ocrd_cli_wrap_processor(processorClass, mets_url=None, working_dir=None, cache_enabled=True, *args, **kwargs):
if mets_url.find('://') == -1:
mets_url = 'file://' + mets_url
if mets_url.startswith('file://') and not os.path.exists(mets_url[len('file://'):]):
raise Exception("File does not exist: %s" % mets_url)
resolver = Resolver(cache_enabled=cache_enabled)
- workspace = resolver.workspace_from_url(mets_url)
+ workspace = resolver.workspace_from_url(mets_url, working_dir)
run_processor(processorClass, mets_url, workspace=workspace, *args, **kwargs)
def ocrd_cli_options(f):
