From 4815cbde39d6b18d482c33fa22816ecc8e755d37 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Sun, 30 Aug 2020 16:45:47 +0530 Subject: stores a local copy in the reports folder --- app/dock-single.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/dock-single.py') diff --git a/app/dock-single.py b/app/dock-single.py index be623f7..af6c4c4 100644 --- a/app/dock-single.py +++ b/app/dock-single.py @@ -202,11 +202,12 @@ date = records[6] import os cd = os.getcwd() f = os.path.join(cd,"static/uploads") +reportDirectory = os.path.join(f,"reports") #t = os.path.join(f,"receptor",target) #r = os.path.join(f,"ligands",ligand) #c = os.path.join(f,"configs",config) import tempfile -from shutil import make_archive +from shutil import make_archive, copyfile import time with tempfile.TemporaryDirectory() as directory: @@ -228,6 +229,7 @@ with tempfile.TemporaryDirectory() as directory: z = "Curie_Web_Result_"+str(jobID) zi = os.path.join(f,z) make_archive(zi, 'zip', directory) + copyfile("report.pdf",os.path.join(reportDirectory,(str(jobID)+".pdf"))) #copy(("Curie_Web_Result_"+str(jobID)),f) email(zi) #print((str(zi) + ".zip")) -- cgit v1.2.3