mirror of
https://github.com/qurator-spk/ocrd-galley.git
synced 2025-06-09 14:49:53 +02:00
🐛 ppn2ocr: Gracefully handle documents without DEFAULT, e.g. multi-volume works
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
This commit is contained in:
parent
691be243f6
commit
7add6858fc
1 changed files with 4 additions and 0 deletions
4
ppn2ocr
4
ppn2ocr
|
@ -99,6 +99,10 @@ def make_workspace(ppn, workspace):
|
|||
# Duplicate DEFAULT file group into a new file group MAX
|
||||
format_ = 'tif'
|
||||
file_grp_default = mets.find('//mets:fileGrp[@USE="DEFAULT"]', namespaces=XMLNS)
|
||||
|
||||
if file_grp_default is None:
|
||||
raise ValueError("This document has no DEFAULT file group, could be a multi-volume work")
|
||||
|
||||
file_grp_best = deepcopy(file_grp_default)
|
||||
|
||||
file_grp_best.attrib['USE'] = 'MAX'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue