From 3c5ff87881d95bf0a5910caae56468b3a36d0142 Mon Sep 17 00:00:00 2001 From: DeltaDaniel <139119540+DeltaDaniel@users.noreply.github.com> Date: Mon, 29 Jul 2024 13:38:44 +0200 Subject: [PATCH] ignore capitalization in filenames when filtering for the latest file --- src/kohlrahbi/docxfilefinder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kohlrahbi/docxfilefinder.py b/src/kohlrahbi/docxfilefinder.py index 7fe4b4b0..52034d6c 100644 --- a/src/kohlrahbi/docxfilefinder.py +++ b/src/kohlrahbi/docxfilefinder.py @@ -116,8 +116,8 @@ def filter_latest_version(groups: dict[str, list[Path]]) -> list[Path]: ( path for path in group_items - if "KonsolidierteLesefassungmitFehlerkorrekturen" in path.name - or "AußerordentlicheVeröffentlichung" in path.name + if "konsolidiertelesefassungmitfehlerkorrekturen" in path.name.lower() + or "außerordentlicheveröffentlichung" in path.name.lower() ), key=lambda path: (int(path.stem.split("_")[-1])), )