about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander_Kabui2025-01-09 12:06:46 +0300
committerAlexander_Kabui2025-01-09 13:05:27 +0300
commit200deff652bfae364d6e15ff2bceefdc1686f158 (patch)
tree6556b96aece75fddf563753b5e089a6608fbd88c
parentec0b1563cce151ef8de5f92f61342924d87d63b0 (diff)
downloadgenenetwork3-200deff652bfae364d6e15ff2bceefdc1686f158.tar.gz
Typo fixes.
-rw-r--r--gn3/computations/streaming.py14
1 files changed, 7 insertions, 7 deletions
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