From 726ef5b50a90a08ddb1fddd3d0fa8775e21b1c35 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Tue, 22 Sep 2020 14:09:53 +0530 Subject: [PATCH] fixed Docking --- app/views.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/views.py b/app/views.py index 1f02162..fd44f6d 100644 --- a/app/views.py +++ b/app/views.py @@ -32,6 +32,8 @@ misc = configparser.ConfigParser() misc.read('app/misc.ini') errors = misc['ERRORS'] +base = os.getcwd() + # Note: that when using Flask-WTF we need to import the Form Class that we created # in forms.py from .forms import MyForm, curieForm, statusForm, generateSMILES, PyMedSearch, dockSingleForm, generatePDBQTS @@ -232,7 +234,7 @@ def generate_pdbqts(): return render_template('error.html',code="OD03",description=errors['OD03']) os.rename(path,"app/.pdbqt") path = ".pdbqt" - fname = pdbId.upper() + ".pdqbt" + fname = pdbId.upper() + ".pdbqt" return send_file(path,attachment_filename=fname,as_attachment=True) flash_errors(myform) return render_template('pdbqt_form.html',form=myform) @@ -319,9 +321,11 @@ def dock_manual(): mycon.commit() log(("Description",description),"DEBUG") - cwd = os.path.join(os.getcwd(),"app") + print(base) + cwd = os.path.join(base,"app") + if app.config['INSTANT_EXEC']: - subprocess.Popen(['python3', 'dock-docker.py'],cwd=cwd) + subprocess.Popen(['python3', 'dock-manual.py'],cwd=cwd) return render_template('display_result.html', filename="OwO", description=description,job=jobID) flash_errors(form) @@ -357,7 +361,9 @@ def dock_automatic(): log(("Description",description),"DEBUG") - cwd = os.path.join(os.getcwd(),"app") + #cwd = os.path.join(os.getcwd(),"app") + cwd = os.path.join(base,"app") + if app.config['INSTANT_EXEC']: subprocess.Popen(['python3', 'dock-single.py'],cwd=cwd)