From 9d221ad285e4d41e0a83af88bef8f221356848ba Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Wed, 3 Apr 2024 13:24:32 +0200 Subject: Replace TMPDIR/output with TMPDIR/gn3 so it is clear where it comes from --- gn3/computations/wgcna.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gn3/computations/wgcna.py') diff --git a/gn3/computations/wgcna.py b/gn3/computations/wgcna.py index 01d024b..e6fab26 100644 --- a/gn3/computations/wgcna.py +++ b/gn3/computations/wgcna.py @@ -29,18 +29,18 @@ def stream_cmd_output(socketio, request_data, cmd: str): """function to stream in realtime""" # xtodo syncing and closing /edge cases - socketio.emit("output", {"data": f"calling you script {cmd}"}, + socketio.emit("gn3", {"data": f"calling you script {cmd}"}, namespace="/", room=request_data["socket_id"]) with subprocess.Popen( cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True) as results: if results.stdout is not None: for line in iter(results.stdout.readline, b""): - socketio.emit("output", + socketio.emit("gn3", {"data": line.decode("utf-8").rstrip()}, namespace="/", room=request_data["socket_id"]) socketio.emit( - "output", {"data": + "gn3", {"data": "parsing the output results"}, namespace="/", room=request_data["socket_id"]) @@ -79,8 +79,8 @@ def call_wgcna_script(rscript_path: str, request_data: dict): return run_cmd_results output_file_data = json.load(outputfile) - output_file_data["output"]["image_data"] = process_image( - output_file_data["output"]["imageLoc"]).decode("ascii") + output_file_data["gn3"]["image_data"] = process_image( + output_file_data["gn3"]["imageLoc"]).decode("ascii") # json format only supports unicode string// to get image data reconvert return { -- cgit v1.2.3