Skip to content

Commit

Permalink
bashlib input-files: apply download_file on each input_file
Browse files Browse the repository at this point in the history
  • Loading branch information
bertsky committed Apr 25, 2024
1 parent 95fd6e2 commit 8dae53d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ocrd/cli/bashlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ def bashlib_input_files(**kwargs):
input_file_grp=kwargs['input_file_grp'],
output_file_grp=kwargs['output_file_grp'])
for input_files in processor.zip_input_files(mimetype=None, on_error='abort'):
# ensure all input files exist locally (without persisting them in the METS)
# - this mimics the default behaviour of all Pythonic processors
input_files = [workspace.download_file(input_file)
for input_file in input_files]
for field in ['url', 'local_filename', 'ID', 'mimetype', 'pageId']:
# make this bash-friendly (show initialization for associative array)
if len(input_files) > 1:
Expand Down

0 comments on commit 8dae53d

Please sign in to comment.