1
0
Fork 0
mirror of https://github.com/qurator-spk/modstool.git synced 2025-06-26 12:09:55 +02:00

page_info: Use boolean for indicator variable, str for hrefs

This commit is contained in:
Mike Gerber 2025-06-11 20:41:13 +02:00
parent 64ed7298da
commit d685454c52
3 changed files with 15 additions and 3 deletions

View file

@ -327,6 +327,8 @@ def pages_to_dict(mets, raise_errors=True) -> List[Dict]:
assert file_ is not None
fileGrp_USE = file_.getparent().attrib.get("USE")
file_FLocat_href = (file_.xpath('mets:FLocat/@xlink:href', namespaces=ns) or [None])[0]
if file_FLocat_href is not None:
file_FLocat_href = str(file_FLocat_href)
page_dict[f"fileGrp_{fileGrp_USE}_file_FLocat_href"] = file_FLocat_href
def get_struct_log(*, to_phys):
@ -368,7 +370,7 @@ def pages_to_dict(mets, raise_errors=True) -> List[Dict]:
for struct_div in struct_divs:
type_ = struct_div.attrib.get("TYPE").lower()
assert type_
page_dict[f"structMap-LOGICAL_TYPE_{type_}"] = 1
page_dict[f"structMap-LOGICAL_TYPE_{type_}"] = True
result.append(page_dict)