Merge pull request 'filename-formatting' (#8) from filename-formatting into master

This commit is contained in:
Stefan Haun 2020-03-14 12:12:37 +00:00
commit 44138e941b

View file

@ -3,7 +3,7 @@
import npyscreen
import json
from datetime import date
import datetime
from sys import argv
@ -75,7 +75,9 @@ def main(*_args):
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['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)