util/ProcessLogger.py
changeset 958 511bf048b8b7
parent 788 3cec473bef94
child 1407 cf3d2b53dd68
--- a/util/ProcessLogger.py	Tue Mar 05 20:14:12 2013 +0900
+++ b/util/ProcessLogger.py	Wed Mar 06 09:40:28 2013 +0900
@@ -71,7 +71,7 @@
     def __init__(self, logger, Command, finish_callback = None, 
                  no_stdout = False, no_stderr = False, no_gui = True, 
                  timeout = None, outlimit = None, errlimit = None,
-                 endlog = None, keyword = None, kill_it = False):
+                 endlog = None, keyword = None, kill_it = False, cwd = None):
         self.logger = logger
         if not isinstance(Command, list):
             self.Command_str = Command
@@ -107,7 +107,7 @@
         self.endlock = Lock()
         
         popenargs= {
-               "cwd":os.getcwd(),
+               "cwd":os.getcwd() if cwd is None else cwd,
                "stdin":subprocess.PIPE, 
                "stdout":subprocess.PIPE, 
                "stderr":subprocess.PIPE}