mirror of
https://github.com/qurator-spk/ocrd-galley.git
synced 2025-07-27 13:49:53 +02:00
✨ Validate PPN argument
ppn2ocr expects the PPN to be in the PPNxxxxxxx format, i.e. including the leading 'PPN' string. Validate the argument accordingly.
This commit is contained in:
parent
058df70ece
commit
1a532b1ccc
1 changed files with 7 additions and 1 deletions
8
ppn2ocr
8
ppn2ocr
|
@ -133,8 +133,14 @@ def make_workspace(ppn, workspace):
|
||||||
#sed -i 's#file:///goobi/tiff001/sbb/#file:///srv/digisam_images/sbb/#g' mets.xml
|
#sed -i 's#file:///goobi/tiff001/sbb/#file:///srv/digisam_images/sbb/#g' mets.xml
|
||||||
|
|
||||||
|
|
||||||
|
def validate_ppn(ctx, param, value):
|
||||||
|
if not value.startswith('PPN'):
|
||||||
|
raise click.BadParameter('PPN must be in format PPNxxxxxxxx')
|
||||||
|
else:
|
||||||
|
return value
|
||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
@click.argument('ppn')
|
@click.argument('ppn', callback=validate_ppn)
|
||||||
def ppn2ocr(ppn):
|
def ppn2ocr(ppn):
|
||||||
"""
|
"""
|
||||||
Get METS with best images for a document PPN
|
Get METS with best images for a document PPN
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue