diff --git a/Zugangsdaten.conf b/Zugangsdaten.conf new file mode 100644 index 0000000..80c898f --- /dev/null +++ b/Zugangsdaten.conf @@ -0,0 +1,8 @@ +{ + "Chat_ID": "", + "TOKEN": "", + "mail_folder": "", + "mail_host": "", + "mail_pass": "", + "mail_user": "" +} \ No newline at end of file diff --git a/Zugangsdaten.py b/Zugangsdaten.py new file mode 100644 index 0000000..cca0c65 --- /dev/null +++ b/Zugangsdaten.py @@ -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) \ No newline at end of file