wxPopen.py
changeset 424 86a7c1d11bbd
parent 421 c9ec111ad275
child 686 e4e1da75d411
--- a/wxPopen.py	Thu Oct 22 11:26:45 2009 +0200
+++ b/wxPopen.py	Thu Oct 22 11:27:30 2009 +0200
@@ -69,16 +69,20 @@
 class ProcessLogger:
     def __init__(self, logger, Command, finish_callback=None, no_stdout=False, no_stderr=False, no_gui=True):
         self.logger = logger
-        self.Command_str = Command
-        self.Command = []
-        for i,word in enumerate(Command.replace("'",'"').split('"')):
-            if i % 2 == 0:
-                word = word.strip()
-                if len(word) > 0:
-                    self.Command.extend(word.split())
-            else:
-                self.Command.append(word)
-
+        if not isinstance(Command, list):
+            self.Command_str = Command
+            self.Command = []
+            for i,word in enumerate(Command.replace("'",'"').split('"')):
+                if i % 2 == 0:
+                    word = word.strip()
+                    if len(word) > 0:
+                        self.Command.extend(word.split())
+                else:
+                    self.Command.append(word)
+        else:
+            self.Command = Command
+            self.Command_str = subprocess.list2cmdline(self.Command)
+            
         self.finish_callback = finish_callback
         self.no_stdout = no_stdout
         self.no_stderr = no_stderr
@@ -95,6 +99,7 @@
                "stdin":subprocess.PIPE, 
                "stdout":subprocess.PIPE, 
                "stderr":subprocess.PIPE}
+        
         if no_gui == True and wx.Platform == '__WXMSW__':
             self.startupinfo = subprocess.STARTUPINFO()
             self.startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW