From 0f26809e9979306b2e4dad26cb34709025a1d38e Mon Sep 17 00:00:00 2001 From: Konstantin Baierer Date: Mon, 11 Sep 2023 13:41:11 +0200 Subject: [PATCH] ocrd workspace find --undo-download: more intuitive output --- ocrd/ocrd/cli/workspace.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ocrd/ocrd/cli/workspace.py b/ocrd/ocrd/cli/workspace.py index 4dd6bd42d..eb894bf7b 100644 --- a/ocrd/ocrd/cli/workspace.py +++ b/ocrd/ocrd/cli/workspace.py @@ -444,16 +444,17 @@ def workspace_find(ctx, file_grp, mimetype, page_id, file_id, output_field, down mimetype=mimetype, page_id=page_id, ): + ret_entry = [f.ID if field == 'pageId' else str(getattr(f, field)) or '' for field in output_field] if download and not f.local_filename: workspace.download_file(f) modified_mets = True if wait: time.sleep(wait) if undo_download and f.local_filename: + ret_entry = [f'Removed local_filename {f.local_filename}'] f.local_filename = None modified_mets = True - ret.append([f.ID if field == 'pageId' else str(getattr(f, field)) or '' - for field in output_field]) + ret.append(ret_entry) if modified_mets: workspace.save_mets() if 'pageId' in output_field: