diff --git a/src/manifest_metadata.py b/src/manifest_metadata.py index 877f9e86cf5d46ecb6e51359a8e4885885a72a38..0cde534228aa39b0d8a543b055c30e715ffbd652 100644 --- a/src/manifest_metadata.py +++ b/src/manifest_metadata.py @@ -110,7 +110,6 @@ def get_elem_text_xq(xml: etree._Element, xpath: str) -> str: return norm except AttributeError: logging.warning(f"No text found in {xpath}.") - finally: return '###' @@ -345,7 +344,6 @@ def make_bibl(xml: etree._Element, t: list, zot_data: list) -> str: zot_id = bibl.attrib['zotero'].split(':')[1] except IndexError: logging.warning(f"Zotero ID {bibl.attrib['zotero']} does not comply to standard.") - finally: zot_id = bibl.attrib['zotero'] zotero = [e[zot_id] for e in zot_data if zot_id in e] if norm != "": @@ -373,7 +371,6 @@ def get_history_of_changes(xml: etree._Element) -> dict: text = normalize(change.text) except TypeError: logging.warning("Change element does not have any text.") - finally: text = '###' changes.append({'key': date, 'value': text}) return {'key': 'Änderungshistorie', 'metadata': changes} diff --git a/src/util.py b/src/util.py index 216a1da3ae7ad94fdfcda6aab2ce05b9d0ec8ecb..c3c6cba3faebf17c67c1d949c867e174948d58e9 100644 --- a/src/util.py +++ b/src/util.py @@ -60,7 +60,7 @@ def get_published_manifest_ids() -> list: manifest_ids = [] for name in published: # "a_KTU_1.14.main.41tvp.0.xml" --> "KTU__1.14" - manifest_id = name.split('a_')[1].split('.main')[0].replace(' ', '__') + manifest_id = name.split('a_')[1].split('.main')[0].replace('_', '__') manifest_ids.append(manifest_id) manifest_ids.sort() return manifest_ids