From d744a4602b922360ae4fd2e2ebeb9171c201ea5e Mon Sep 17 00:00:00 2001 From: Rahul Date: Mon, 31 Jul 2023 09:31:08 +0530 Subject: [PATCH] library modified --- fri/server/main.py | 20 -------------------- library | 3 ++- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/fri/server/main.py b/fri/server/main.py index deae96c..df04616 100644 --- a/fri/server/main.py +++ b/fri/server/main.py @@ -117,42 +117,34 @@ def build(dir): output_bytes = subprocess.check_output(["makedocker", makestudy_dir], cwd=concore_path, shell=True) output_str = output_bytes.decode("utf-8") proc = 0 - print(output_str) except subprocess.CalledProcessError as e: output_str = f"Docker study creation failed with return code {e.returncode} (check duplicate directory)" proc = 1 - print(output_str) else: try: output_bytes = subprocess.check_output(["makestudy", makestudy_dir], cwd=concore_path, shell=True) output_str = output_bytes.decode("utf-8") proc = 0 - print(output_str) except subprocess.CalledProcessError as e: output_str = f"Study creation failed with return code {e.returncode} (check duplicate directory)" proc = 1 - print(output_str) else: if(docker == 'true'): try: output_bytes = subprocess.check_output(["makedocker", makestudy_dir, out_dir], cwd=concore_path, shell=True) output_str = output_bytes.decode("utf-8") proc = 0 - print(output_str) except subprocess.CalledProcessError as e: output_str = f"Docker study creation failed with return code {e.returncode} (check duplicate directory)" proc = 1 - print(output_str) else: try: output_bytes = subprocess.check_output(["makestudy", makestudy_dir, out_dir], cwd=concore_path, shell=True) output_str = output_bytes.decode("utf-8") proc = 0 - print(output_str) except subprocess.CalledProcessError as e: output_str = f"Study creation failed with return code {e.returncode} (check duplicate directory)" proc = 1 - print(output_str) else: if(out_dir == None or out_dir == ""): if(docker == 'true'): @@ -160,42 +152,34 @@ def build(dir): output_bytes = subprocess.check_output(["./makedocker", makestudy_dir], cwd=concore_path) output_str = output_bytes.decode("utf-8") proc = 0 - print(output_str) except subprocess.CalledProcessError as e: output_str = f"Docker study creation failed with return code {e.returncode} (check duplicate directory)" proc = 1 - print(output_str) else: try: output_bytes = subprocess.check_output(["./makestudy", makestudy_dir], cwd=concore_path) output_str = output_bytes.decode("utf-8") proc = 0 - print(output_str) except subprocess.CalledProcessError as e: output_str = f"Study creation failed with return code {e.returncode} (check duplicate directory)" proc = 1 - print(output_str) else: if(docker == 'true'): try: output_bytes = subprocess.check_output(["./makedocker", makestudy_dir, out_dir], cwd=concore_path) output_str = output_bytes.decode("utf-8") proc = 0 - print(output_str) except subprocess.CalledProcessError as e: output_str = f"Docker study creation failed with return code {e.returncode} (check duplicate directory)" proc = 1 - print(output_str) else: try: output_bytes = subprocess.check_output(["./makestudy", makestudy_dir, out_dir], cwd=concore_path) output_str = output_bytes.decode("utf-8") proc = 0 - print(output_str) except subprocess.CalledProcessError as e: output_str = f"Study creation failed with return code {e.returncode} (check duplicate directory)" proc = 1 - print(output_str) if(proc == 0): resp = jsonify({'message': 'Directory successfully created'}) resp.status_code = 201 @@ -206,11 +190,9 @@ def build(dir): try: output_bytes = subprocess.check_output("build", cwd=dir_path, shell=True) output_str = output_str + output_bytes.decode("utf-8") - print(output_str) resp = jsonify({'message': 'Directory successfully created', 'output': output_str}) except subprocess.CalledProcessError as e: output_str = f"Build failed with return code {e.returncode}" - print(output_str) resp = jsonify({'message': 'Build Failed', 'output': output_str}) resp.status_code = 500 if(maxtime != None and maxtime != ''): @@ -221,11 +203,9 @@ def build(dir): try: output_bytes = subprocess.check_output("./build", cwd=dir_path) output_str = output_str + output_bytes.decode("utf-8") - print(output_str) resp = jsonify({'message': 'Directory successfully created', 'output': output_str}) except subprocess.CalledProcessError as e: output_str = f"Build failed with return code {e.returncode}" - print(output_str) resp = jsonify({'message': 'Build Failed', 'output': output_str}) resp.status_code = 500 if(maxtime != None and maxtime != ''): diff --git a/library b/library index 0d64dee..f00bfee 100755 --- a/library +++ b/library @@ -25,8 +25,9 @@ if [ $# = 0 ] if [ -e $tooldir/$filename ] then ln -s $tooldir/$filename $filename + echo "library link created" else - echo "$filename does not exist" + echo "$filename does not exist in $tooldir" fi else echo "$tooldir does not exist"