aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2020-09-27 11:10:52 +0530
committerNavan Chauhan <navanchauhan@gmail.com>2020-09-27 11:10:52 +0530
commitb4dae59394a4cb7312b9598c5bef607633fe5eaa (patch)
tree72d8ff63bc5701515bf7b278f7208d8fbe6c5830
parentbb02df97a6d6562b3302dc23c42da421565feb85 (diff)
moved reading config to misc
-rw-r--r--app/misc/config.py13
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