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 b25c673055 - Show all commits

View file

@ -3,7 +3,7 @@
import npyscreen
import json
from datetime import date
import datetime
from sys import argv
@ -91,13 +91,20 @@ def main(*_args):
zip(app.finance_widgets.keys(), map(lambda f: f.value, app.finance_widgets.values())))
new_data['mitgliederdaten'] = dict(
zip(app.member_widgets.keys(), map(lambda f: f.value, app.member_widgets.values())))
new_data['stammdaten'] = dict(zip(app.base_data_widgets.keys(), map(lambda f: f.value, app.base_data_widgets.values())))
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']}"
outfile_name = '{}_{}.json'.format(date.today().isoformat(
), '_'.join(new_data['stammdaten']['fullname'].split()))
new_data['finanzdaten'] = dict(zip(app.finance_widgets.keys(), map(lambda f: f.value, app.finance_widgets.values())))
new_data['mitgliederdaten'] = dict(zip(app.member_widgets.keys(), map(lambda f: f.value, app.member_widgets.values())))
new_data['timestamp'] = datetime.datetime.now().replace(microsecond=0).isoformat()
outfile_name = '{}_{}.json'.format('_'.join(new_data['stammdaten']['fullname'].split()), datetime.datetime.now().replace(microsecond=0).isoformat())
with open(outfile_name, 'w') as outfile:
json.dump(new_data, outfile, sort_keys=True, indent=4)