added active state to csv export

This commit is contained in:
2025-04-13 23:37:51 +02:00
parent cda79f781e
commit e68338e427
2 changed files with 4 additions and 2 deletions

View File

@@ -1,2 +1 @@
muster-firma,"peter, muster",peterstrasse,peterort c3000,erich roth,zentralstrasse 120,5430 wettingen
hans muster,musterstrasse,musterort
Can't render this file because it has a wrong number of fields in line 2.

View File

@@ -166,6 +166,9 @@ class Application:
with open(csv_file, "w", encoding="utf-8") as f: with open(csv_file, "w", encoding="utf-8") as f:
writer = csv.writer(f, delimiter=",") writer = csv.writer(f, delimiter=",")
for address in self.address_list: for address in self.address_list:
if address[0] != "x":
continue
del address[0]
if address[0] == "": if address[0] == "":
del address[0] del address[0]
writer.writerow(address) writer.writerow(address)