allow passing environment variables to ProcessLogger python3
authorGP Orcullo <kinsamanka@gmail.com>
Fri, 10 Feb 2023 10:02:21 +0800
branchpython3
changeset 3786 50935528d313
parent 3785 29bc2bebf1d4
child 3787 56ceda9889f8
allow passing environment variables to ProcessLogger
util/ProcessLogger.py
--- a/util/ProcessLogger.py	Mon Feb 06 20:07:51 2023 +0800
+++ b/util/ProcessLogger.py	Fri Feb 10 10:02:21 2023 +0800
@@ -78,7 +78,7 @@
                  no_stdout=False, no_stderr=False, no_gui=True,
                  timeout=None, outlimit=None, errlimit=None,
                  endlog=None, keyword=None, kill_it=False, cwd=None,
-                 encoding=None, output_encoding=None):
+                 encoding=None, output_encoding=None, env=None):
         self.logger = logger
         if not isinstance(Command, list):
             self.Command_str = Command
@@ -122,7 +122,8 @@
             "cwd":    os.getcwd() if cwd is None else cwd,
             "stdin":  subprocess.PIPE,
             "stdout": subprocess.PIPE,
-            "stderr": subprocess.PIPE
+            "stderr": subprocess.PIPE,
+            "env":    env
         }
 
         if no_gui and os.name in ("nt", "ce"):