From ddffb76fb6a8c32a8950dee998a8c38b354d6e8d Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Mon, 27 Nov 2023 16:35:48 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20getting=20parent=20element?= =?UTF-8?q?s=20if=20necessary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qurator/mods4pandas/mods4pandas.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qurator/mods4pandas/mods4pandas.py b/qurator/mods4pandas/mods4pandas.py index 7229d37..ffc3697 100755 --- a/qurator/mods4pandas/mods4pandas.py +++ b/qurator/mods4pandas/mods4pandas.py @@ -323,8 +323,10 @@ def pages_to_dict(mets, raise_errors=True) -> List[Dict]: while (cursor := cursor.getparent()).tag == f"{{{ns['mets']}}}div": yield cursor + struct_divs_to_add = set() for struct_div in struct_divs: - struct_divs.update(get_struct_log_parents(struct_div)) + struct_divs_to_add.update(get_struct_log_parents(struct_div)) + struct_divs.update(struct_divs_to_add) for struct_div in struct_divs: type_ = struct_div.attrib.get("TYPE")