diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2020-09-27 11:10:52 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2020-09-27 11:10:52 +0530 |
commit | b4dae59394a4cb7312b9598c5bef607633fe5eaa (patch) | |
tree | 72d8ff63bc5701515bf7b278f7208d8fbe6c5830 /app | |
parent | bb02df97a6d6562b3302dc23c42da421565feb85 (diff) |
moved reading config to misc
Diffstat (limited to 'app')
-rw-r--r-- | app/misc/config.py | 13 |
1 files changed, 13 insertions, 0 deletions
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 |