From 7cd8d4accc933c7e6a4e4091f5d6e052d1af4c42 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Sun, 27 Sep 2020 21:13:31 +0530 Subject: fixed to work with launchd --- app/dock-manual.py | 4 ++-- app/dock-single.py | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/dock-manual.py b/app/dock-manual.py index 2d69294..eb11b6a 100644 --- a/app/dock-manual.py +++ b/app/dock-manual.py @@ -94,9 +94,9 @@ with tempfile.TemporaryDirectory() as directory: arch = os.popen("uname -m").read() print("Generating 3D Model") if "x86" in arch: - os.system("docker run -it --rm -v $(pwd):/usr/app leon/usd-from-gltf:latest model.gltf model.usdz") + os.system("docker run --rm -v $(pwd):/usr/app leon/usd-from-gltf:latest model.gltf model.usdz") elif "aarch64" in arch: - os.system("docker run -it --rm -v $(pwd):/usr/app navanchauhan/usd-from-gltf:latest model.gltf model.usdz") + os.system("docker run --rm -v $(pwd):/usr/app navanchauhan/usd-from-gltf:latest model.gltf model.usdz") try: copyfile("model.usdz",os.path.join(modelDirectory,(str(jobID)+".usdz"))) except FileNotFoundError: diff --git a/app/dock-single.py b/app/dock-single.py index c09d262..add20da 100644 --- a/app/dock-single.py +++ b/app/dock-single.py @@ -167,6 +167,7 @@ date = records[6] cd = os.getcwd() +print("Curie-Web Directory is:",cd) f = os.path.join(cd,"static/uploads") scripts = os.path.join(cd,"scripts") reportDirectory = os.path.join(f,"reports") @@ -222,27 +223,29 @@ with tempfile.TemporaryDirectory() as directory: try: copyfile("report.pdf",os.path.join(reportDirectory,(str(jobID)+".pdf"))) except FileNotFoundError: - reason = "Could not generate the report, this could be because of a failed docking job. Please check the ZIP archive for the configuration and converted PDBQTs and try submitting manually. " + reason = "Could not generate the PDF report, this could be because of a failed docking job. Please check the ZIP archive for the configuration and converted PDBQTs and try submitting manually. " email(toaddr,jobID,date,description,zipArchive=zi,reason=reason) mycursor.execute('UPDATE curieweb set done=1 where id="%s"' % (jobID)) mycon.commit() sys.exit(0) + """ try: get3DModel(pdbpath,"%s_out.pdbqt"%(records[4])) except: - reason = "Could not generate the report, this could be because of a failed docking job. Please check the ZIP archive for the configuration and converted PDBQTs and try submitting manually. " - email(toaddr,jobID,date,description,zipArchive=zi,reason=reason) + email(toaddr,jobID,date,description,zipArchive=zi) mycursor.execute('UPDATE curieweb set done=1 where id="%s"' % (jobID)) mycon.commit() sys.exit(0) + """ + get3DModel(pdbpath,"%s_out.pdbqt"%(records[4])) os.system("collada2gltf -i model.dae -o model.gltf") copyfile("model.gltf",os.path.join(modelDirectory,(str(jobID)+".gltf"))) arch = os.popen("uname -m").read() print("Generating 3D Model") if "x86" in arch: - os.system("docker run -it --rm -v $(pwd):/usr/app leon/usd-from-gltf:latest model.gltf model.usdz") + os.system("docker run --rm -v $(pwd):/usr/app leon/usd-from-gltf:latest model.gltf model.usdz") elif "aarch64" in arch: - os.system("docker run -it --rm -v $(pwd):/usr/app navanchauhan/usd-from-gltf:latest model.gltf model.usdz") + os.system("docker run --rm -v $(pwd):/usr/app navanchauhan/usd-from-gltf:latest model.gltf model.usdz") try: copyfile("model.usdz",os.path.join(modelDirectory,(str(jobID)+".usdz"))) except: -- cgit v1.2.3