support for config file
This commit is contained in:
parent
869714f926
commit
caf9db541f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user