From 200deff652bfae364d6e15ff2bceefdc1686f158 Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Thu, 9 Jan 2025 12:06:46 +0300 Subject: Typo fixes. --- gn3/computations/streaming.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gn3/computations/streaming.py') diff --git a/gn3/computations/streaming.py b/gn3/computations/streaming.py index 1cebde3..b5afb5b 100644 --- a/gn3/computations/streaming.py +++ b/gn3/computations/streaming.py @@ -14,7 +14,7 @@ def run_process(cmd, output_file, run_id): run_id: unique id to identify the process output: - Dict with the results o either success or failure. + Dict with the results for either success or failure. """ try: # phase: execute the rscript cmd @@ -24,7 +24,7 @@ def run_process(cmd, output_file, run_id): stderr=subprocess.STDOUT, ) as process: for line in iter(process.stdout.readline, b""): - # phase: capture the stdout for eaching line allowing read and write + # phase: capture the stdout for each line allowing read and write with open(output_file, "a+", encoding="utf-8") as file_handler: file_handler.write(line.decode("utf-8")) process.wait() @@ -39,16 +39,16 @@ def run_process(cmd, output_file, run_id): def enable_streaming(func): """Decorator function to enable streaming for an endpoint - Note: should be used only in an app context + Note: should only be used in an app context """ @wraps(func) def decorated_function(*args, **kwargs): run_id = request.args.get("id") - stream_ouput_file = os.path.join(current_app.config.get("TMPDIR"), - f"{run_id}.txt") - with open(stream_ouput_file, "w+", encoding="utf-8", + stream_output_file = os.path.join(current_app.config.get("TMPDIR"), + f"{run_id}.txt") + with open(stream_output_file, "w+", encoding="utf-8", ) as file_handler: file_handler.write("File created for streaming\n" ) - return func(stream_ouput_file, *args, **kwargs) + return func(stream_output_file, *args, **kwargs) return decorated_function -- cgit 1.4.1