Ausgabe der neuen DB Einträge

This commit is contained in:
hubobel 2022-02-24 22:41:23 +01:00
parent 3a917e4115
commit cac14d6a93
2 changed files with 28 additions and 0 deletions

8
Zugangsdaten.conf Normal file
View file

@ -0,0 +1,8 @@
{
"Chat_ID": "",
"TOKEN": "",
"mail_folder": "",
"mail_host": "",
"mail_pass": "",
"mail_user": ""
}

20
Zugangsdaten.py Normal file
View file

@ -0,0 +1,20 @@
import json
import os
import sys
conf = os.path.basename(sys.argv[0])
conf = conf.replace(".py", ".conf")
if os.path.isfile(conf) is False:
print(conf + ' scheint es nicht zu geben.')
print('Ich lege eine neue Datei '+ conf + ' an.')
passw={"mail_pass": "","mail_user": "",
"mail_host": "",
"mail_folder": "",
"Chat_ID": "","TOKEN": ""
}
print(str(conf)+ ' bitte entsprechend befüllen.')
with open(conf, 'w') as fp:
json.dump(passw, fp, sort_keys=True, indent=4)
quit()
else:
with open(conf) as file:
passw = json.load(file)