diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2020-09-08 20:03:41 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2020-09-08 20:03:41 +0530 |
commit | 37076cab79175c0797ce781bb1cc4cd8e60187ce (patch) | |
tree | 0ea3f392124d108ca623cc93bf5f0ed41c4d8354 /app/dock_docker.py | |
parent | b8ada840cfd5348d617ed3b1f35003ae622c9175 (diff) |
added single config.ini to change variables
Diffstat (limited to 'app/dock_docker.py')
-rw-r--r-- | app/dock_docker.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/app/dock_docker.py b/app/dock_docker.py index a36648e..5869c21 100644 --- a/app/dock_docker.py +++ b/app/dock_docker.py @@ -1,6 +1,15 @@ 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 * from curieweb where done=0 LIMIT 1" @@ -47,17 +56,17 @@ def email(zipArchive): def get3DModel(protein,ligand): try: - import pymol2 + import pymol2 except ImportError: print("🤠PyMOL 2 has not been installed correctly") return None - session = pymol2.PyMOL() - session.start() - cmd = session.cmd - cmd.load(protein,"target") - cmd.load(ligand,"ligand") - cmd.save("model.dae") - session.stop() + session = pymol2.PyMOL() + session.start() + cmd = session.cmd + cmd.load(protein,"target") + cmd.load(ligand,"ligand") + cmd.save("model.dae") + session.stop() receptor_name = "protein.pdbqt" ligand_name = "ligand.pdbqt" |