address_label #3

Merged
tux merged 6 commits from address_label into master 2020-03-14 22:08:20 +01:00
Showing only changes of commit 96b06d33e0 - Show all commits

View file

@ -72,10 +72,11 @@ def main(*_args):
app = FormApp(member_struct)
app.run()
new_data = {}
new_data['stammdaten'] = dict(zip(app.sd2.keys(), map(lambda f: f.value, app.sd2.values())))
new_data['finanzdaten'] = dict(zip(app.fin2.keys(), map(lambda f: f.value, app.fin2.values())))
new_data['mitgliederdaten'] = dict(zip(app.mem2.keys(), map(lambda f: f.value, app.mem2.values())))
outfile_name = '{}_{}.json'.format(date.today().isoformat(), '_'.join(new_data['stammdaten']['fullname'].split()))
new_data['stammdaten']['address_label'] = \
f"{new_data['stammdaten']['fullname']}\n \
{new_data['stammdaten']['address_street']}\n \
{new_data['stammdaten']['address_code']} {new_data['stammdaten']["address_locality"]}"
with open(outfile_name, 'w') as outfile:
json.dump(new_data, outfile, sort_keys=True, indent=4)