OcrdMets.add_file: fix fileGrp regex exception msg
@@ -158,7 +158,6 @@ class OcrdMets(OcrdXmlDocument):
Yields:
:py:class:`ocrd_models:ocrd_file:OcrdFile` instantiations
"""
- ret = []
if pageId:
if pageId.startswith(REGEX_PREFIX):
raise Exception("find_files does not support regex search for pageId")
@@ -298,7 +297,7 @@ class OcrdMets(OcrdXmlDocument):
if not REGEX_FILE_ID.fullmatch(ID):
raise ValueError("Invalid syntax for mets:file/@ID %s (not an xs:ID)" % ID)
if not REGEX_FILE_ID.fullmatch(fileGrp):
- raise ValueError("Invalid syntax for mets:fileGrp/@USE %s (not an xs:ID)" % ID)
+ raise ValueError("Invalid syntax for mets:fileGrp/@USE %s (not an xs:ID)" % fileGrp)
el_fileGrp = self._tree.getroot().find(".//mets:fileGrp[@USE='%s']" % (fileGrp), NS)
if el_fileGrp is None:
el_fileGrp = self.add_file_group(fileGrp)
@@ -495,4 +494,3 @@ class OcrdMets(OcrdXmlDocument):
pageId=f_src.pageId)
if after_add_cb:
after_add_cb(f_dest)
-
