Processor.resolve_resource: support on-demand download of URL values #799
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With this in place, users can use URL directly for parameter values:
and it should download on demand the first time it encounters and registers the URL in the user resource_list.yml. Subsequent calls will use the cached download.
In practice though I cannot seem to find an example where this works:
ocrd_{tesserocr,cis-ocropy}
have a different mechanism of model storage. It's still compatible withocrd resmgr download
in tesserocr's case but does not use theself.resolve_resource
method this PR extendsocrd_calamari
requires a directory of files, or an archive which is too complex to do on demand in a generalized way IMHOocrd-page-transform
is a bashlib processor and won't support this.So if anybody has a good idea on how to test and/or generalize this to make it available to all the processors, pls let me know.