From b4dae59394a4cb7312b9598c5bef607633fe5eaa Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Sun, 27 Sep 2020 11:10:52 +0530 Subject: moved reading config to misc --- app/misc/config.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 app/misc/config.py diff --git a/app/misc/config.py b/app/misc/config.py new file mode 100644 index 0000000..34096f6 --- /dev/null +++ b/app/misc/config.py @@ -0,0 +1,13 @@ +import configparser +import sys + +iniConfig = configparser.ConfigParser() +iniConfig.read('config.ini') + +try: + iniConfig['DATABASE'] +except KeyError: + try: + iniConfig.read("../config.ini") + except KeyError: + iniConfig.read("../../config.ini") \ No newline at end of file -- cgit v1.2.3