support for config file

This commit is contained in:
Guilhem Fauré 2023-05-16 11:37:34 +02:00
parent 869714f926
commit caf9db541f

View File

@ -1,6 +1,10 @@
from os.path import isfile
from yaml import CLoader as Loader
from yaml import load
configPaths: tuple = ("spip2md.yml", "spip2md.yaml")
class Configuration:
db = "spip"
@ -26,5 +30,9 @@ class Configuration:
self.defaultNbToExport = config["defaultNbToExport"]
# config = Configuration("spip2md.yml")
config = Configuration()
for path in configPaths:
if isfile(path):
config = Configuration(path)
break