migrate.py: update address migration

This commit is contained in:
2023-11-15 22:32:29 +01:00
parent 2603da5537
commit 3be0101e6a

View File

@ -110,6 +110,7 @@ ORT_NAMES: Dict[str, Optional[str]] = {
'Znaim': None,
'Obersdorf': None,
'Sechshaus': None,
'Rußbach': None,
}
STREET_NAMES: Dict[str, str] = {
@ -148,6 +149,8 @@ STREET_NAMES: Dict[str, str] = {
'Manhartsbr.Straße': 'Manhartsbrunner Straße',
'Maria Lourd Weg': 'Maria-Lourd-Weg',
'U. Weißgasse Straße': 'Untere Weißgerberstraße',
'Dr. Josef-Levit-Straße': 'Dr.-Josef-Levit-Straße',
'Karl Katschthaler-Straße': 'Karl-Katschthaler-Straße',
}
@ -892,7 +895,7 @@ def migrate_members(in_dir: str, out_dir: str) -> None:
if address.startswith('Haus Nr.') or \
address.startswith('Nr. ') or \
address.startswith('Nr ') or \
address.isdigit() or (len(address) > 1 and address[:-1].isdigit()):
(len(address) > 0 and address[0].isdigit()):
address = ort.title() + ' ' + address.split(' ')[-1]
address = address.replace('strasse', 'straße').replace('strassse', 'straße')\
.replace('Strasse', 'Straße').replace('Str.', 'Straße').replace('stasse', 'straße')\