Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workspace merge fix #926

Merged
merged 8 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ocrd/ocrd/cli/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ def merge(ctx, overwrite, copy_files, filegrp_mapping, fileid_mapping, pageid_ma
file_grp=file_grp,
file_id=file_id,
page_id=page_id,
mimetype=mimetype,
mimetype=mimetype
)
workspace.save_mets()

Expand Down
5 changes: 3 additions & 2 deletions ocrd_models/ocrd_models/ocrd_mets.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def remove_physical_page_fptr(self, fileId):
mets_div.remove(mets_fptr)
return ret

def merge(self, other_mets, fileGrp_mapping=None, fileId_mapping=None, pageId_mapping=None, after_add_cb=None, **kwargs):
def merge(self, other_mets, overwrite=True, fileGrp_mapping=None, fileId_mapping=None, pageId_mapping=None, after_add_cb=None, **kwargs):
kba marked this conversation as resolved.
Show resolved Hide resolved
"""
Add all files from other_mets.

Expand All @@ -509,7 +509,8 @@ def merge(self, other_mets, fileGrp_mapping=None, fileId_mapping=None, pageId_ma
mimetype=f_src.mimetype,
url=f_src.url,
ID=fileId_mapping.get(f_src.ID, f_src.ID),
pageId=pageId_mapping.get(f_src.pageId, f_src.pageId))
pageId=pageId_mapping.get(f_src.pageId, f_src.pageId),
force=overwrite)
kba marked this conversation as resolved.
Show resolved Hide resolved
kba marked this conversation as resolved.
Show resolved Hide resolved
# FIXME: merge metsHdr, amdSec, dmdSec as well
# FIXME: merge structMap logical and structLink as well
if after_add_cb:
Expand Down