Database: allow mysql, config in ini file

Also check for ini file existence at startup
This commit is contained in:
2022-07-20 23:31:12 +02:00
parent 7f33df91ef
commit 25c5a4179c
4 changed files with 36 additions and 3 deletions

View File

@@ -2,4 +2,10 @@ from configparser import ConfigParser
import os
conf = ConfigParser()
conf.read(os.path.dirname(__file__) + "/fioul.ini")
ini_file = os.path.dirname(__file__) + "/fioul.ini"
try:
conf.read_file(open(ini_file))
except FileNotFoundError:
print("Configuration file 'fioul.ini' not found")
print("Please take a look at 'fioul.ini.example' to create one")
exit(42)