From caf9db541f1465482318e2af2357f05ecddcf49c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilhem=20Faur=C3=A9?= Date: Tue, 16 May 2023 11:37:34 +0200 Subject: [PATCH] support for config file --- spip2md/config.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spip2md/config.py b/spip2md/config.py index 1609640..8bc715c 100644 --- a/spip2md/config.py +++ b/spip2md/config.py @@ -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