migrate.py: clean up a bit

This commit is contained in:
2023-05-02 21:32:50 +02:00
parent ea6955926c
commit 19b2bccae3

View File

@ -715,13 +715,11 @@ def migrate_area_commitments(in_dir: str, out_dir: str) -> None:
invalid(mgnr, 'GstNr.', f'{kgnr or 0:05}-{parz}') invalid(mgnr, 'GstNr.', f'{kgnr or 0:05}-{parz}')
gstnrs = [] gstnrs = []
gstnr = '-' gstnr = '-'
elif len(gstnrs) > 1 or (len(gstnrs) == 1 and gstnrs[0] != parz):
convert(mgnr, 'GstNr.', f'{kgnr or 0:05}-{parz or ""}', ', '.join(gstnrs))
if len(gstnrs) == 0: if len(gstnrs) == 0:
comment = f'KG {kgnr:05}: {parz}' comment = f'KG {kgnr:05}: {parz}'
gstnr = format_gstnr(gstnrs) or gstnr or parz gstnr = format_gstnr(gstnrs) or gstnr or parz
if parz != gstnr.replace('+', '/'): if parz != gstnr.replace('+', '/'):
print(f'{parz or "None":36} -> {gstnr}') convert(mgnr, f'GstNr. ({fbnr})', parz, gstnr)
rdnr = REED_MAP[fb['RNR']][1] if fb['RNR'] else None rdnr = REED_MAP[fb['RNR']][1] if fb['RNR'] else None
to = fb['Bis'] if fb['Bis'] and fb['Bis'] < 3000 else None to = fb['Bis'] if fb['Bis'] and fb['Bis'] < 3000 else None