aboutsummaryrefslogtreecommitdiff
path: root/app/dock-single.py
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2020-09-08 20:03:41 +0530
committerNavan Chauhan <navanchauhan@gmail.com>2020-09-08 20:03:41 +0530
commit37076cab79175c0797ce781bb1cc4cd8e60187ce (patch)
tree0ea3f392124d108ca623cc93bf5f0ed41c4d8354 /app/dock-single.py
parentb8ada840cfd5348d617ed3b1f35003ae622c9175 (diff)
added single config.ini to change variables
Diffstat (limited to 'app/dock-single.py')
-rw-r--r--app/dock-single.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/dock-single.py b/app/dock-single.py
index a94f3e9..b5d9351 100644
--- a/app/dock-single.py
+++ b/app/dock-single.py
@@ -8,7 +8,16 @@ from collections import namedtuple
import mysql.connector as con
-mycon = con.connect(host='192.168.1.6',user="curieweb",password="curie-web-russian-54",port=3306,database="curie")
+import configparser
+config = configparser.ConfigParser()
+config.read('config.ini')
+
+try:
+ config['DATABASE']
+except KeyError:
+ config.read("../config.ini")
+
+mycon = con.connect(host=config['DATABASE']['HOST'],user=config['DATABASE']['USER'],password=config['DATABASE']['PASSWORD'],port=config['DATABASE']['PORT'],database=config['DATABASE']['NAME'])
mycursor = mycon.cursor()
sql_select_Query = "SELECT id,email,pdb,ligand_smile,ligand_name,description,date FROM curieweb WHERE pdb IS NOT NULL AND done=0 LIMIT 1"