diff --git a/.~lock.ringe_short_out.xlsx# b/.~lock.ringe_short_out.xlsx# deleted file mode 100644 index a9de537..0000000 --- a/.~lock.ringe_short_out.xlsx# +++ /dev/null @@ -1 +0,0 @@ -,someone,nixLap,28.03.2026 12:13,file:///home/someone/.config/yolk/eggs/libreoffice/4; \ No newline at end of file diff --git a/data/.~lock.zählungen_short.xlsx# b/data/.~lock.zählungen_short.xlsx# deleted file mode 100644 index a9de537..0000000 --- a/data/.~lock.zählungen_short.xlsx# +++ /dev/null @@ -1 +0,0 @@ -,someone,nixLap,28.03.2026 12:13,file:///home/someone/.config/yolk/eggs/libreoffice/4; \ No newline at end of file diff --git a/fledermaus_formatter/instructions/mappings.py b/fledermaus_formatter/instructions/mappings.py index 051d245..6766073 100644 --- a/fledermaus_formatter/instructions/mappings.py +++ b/fledermaus_formatter/instructions/mappings.py @@ -38,7 +38,7 @@ SPICIES = { "P.pip.", "P.pip", "PPIP", - "P.p." + "P.p.", "ppip", "Pipistrellus pipistrellus", ], @@ -180,7 +180,7 @@ SPICIES = { "unbekannt", "unb.", "Unbestimmt", - "Mspecbech" + "Mspecbech", ], "Malc": [ "M.alc.", @@ -256,7 +256,7 @@ SPICIES = { "MMYO", "mmyo", "Myotis Myotis", - "Mspec.bech" + "Mspec.bech", "M.m.", "M.m", "MM", @@ -310,18 +310,18 @@ CATCHED_BY = [ AGE = { "j": [ "j", - "juv" + "juv", ], "sub": [ "sub", "subad", - "sub ad" + "sub ad", "sub adult", - "sub-adult" + "sub-adult", ], "a": [ "a", - "ad" + "ad", ] } @@ -329,15 +329,15 @@ REPRODUCTION = { "p": [ "plak", "pl", - "p" + "p", ], "g": [ - "g" + "g", ], "z": [ "lak", "l", - "z" + "z", ] } diff --git a/fledermaus_formatter/instructions/ring_formater.py b/fledermaus_formatter/instructions/ring_formater.py index 4fcbfdb..d4cc35d 100644 --- a/fledermaus_formatter/instructions/ring_formater.py +++ b/fledermaus_formatter/instructions/ring_formater.py @@ -24,12 +24,10 @@ COL_INSTRUCTIONS = { { "command": "FIND_AND_REPLACE", "map": REPRODUCTION, - "reqire_full_match": True }, { "command": "FIND_AND_REPLACE", "map": AGE, - "reqire_full_match": True }, { "command": "REGEX_MOVE_TO_COL", @@ -58,7 +56,8 @@ COL_INSTRUCTIONS = { }, ("Art",): { "command": "FIND_AND_REPLACE", - "map": SPICIES + "map": SPICIES, + "reqire_full_match": True }, ("Ort",): { "command": "REGEX_MOVE_TO_COL", diff --git a/fledermaus_formatter/table_handler/commands/find_and_replace.py b/fledermaus_formatter/table_handler/commands/find_and_replace.py index b4a467a..ee562e3 100644 --- a/fledermaus_formatter/table_handler/commands/find_and_replace.py +++ b/fledermaus_formatter/table_handler/commands/find_and_replace.py @@ -9,11 +9,11 @@ class FindAndReplace: def execute_on_cell(self, entry) -> str: res = deepcopy(entry.value) - for species, alternatives in self.map.items(): - for old_version in alternatives: - if self.require_full_match and old_version == res: + for correct_name, bad_names in self.map.items(): + for bad_name in bad_names: + if self.require_full_match and bad_name == res: # Todo remove random leading/trailing spaces before if - res = species + res = correct_name elif not self.require_full_match: - res = res.replace(old_version, species) + res = res.replace(bad_name, correct_name) return res \ No newline at end of file diff --git a/ringe_short_out.xlsx b/ringe_short_out.xlsx index 2273939..b089ad8 100644 Binary files a/ringe_short_out.xlsx and b/ringe_short_out.xlsx differ