From 9abf07a53ac57f6c93132822376e6ff0058f0ad5 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Tue, 22 Sep 2020 17:17:05 +0530 Subject: [PATCH] added try except incase collada2gltf is not there --- app/dock-manual.py | 10 ++++++++-- app/dock-single.py | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/dock-manual.py b/app/dock-manual.py index e2da478..c953a36 100644 --- a/app/dock-manual.py +++ b/app/dock-manual.py @@ -80,7 +80,6 @@ def RemoveAllFilesMatching(directory,pattern): FileList = glob.glob(directory+"/*"+pattern) for FilePath in FileList: try: - print(FilePath) os.remove(FilePath) except: print("Error in removing misc file") @@ -138,7 +137,14 @@ with tempfile.TemporaryDirectory() as directory: copyfile("report.pdf",os.path.join(reportDirectory,(str(jobID)+".pdf"))) get3DModel(receptor_name,ligand_name.replace(".pdbqt","_out.pdbqt")) os.system("collada2gltf -i model.dae -o model.gltf") - copyfile("model.gltf",os.path.join(modelDirectory,(str(jobID)+".gltf"))) + try: + copyfile("model.gltf",os.path.join(modelDirectory,(str(jobID)+".gltf"))) + except: + print("Does not have Collada2GLTF Installed") + email(zi) + mycursor.execute('UPDATE curieweb set done=1 where id="%s"' % (jobID)) + mycon.commit() + exit(0) arch = os.popen("uname -m").read() print("Generating 3D Model") if "x86" in arch: diff --git a/app/dock-single.py b/app/dock-single.py index 3526985..90031a1 100644 --- a/app/dock-single.py +++ b/app/dock-single.py @@ -221,7 +221,6 @@ def RemoveAllFilesMatching(directory,pattern): FileList = glob.glob(directory+"/*"+pattern) for FilePath in FileList: try: - print(FilePath) os.remove(FilePath) except: print("Error in removing misc file")