beremiz

Parents 4d7ac355701d
Children f390e9fdd2cf
support for passing list command to ProcessLogger
  • +15 -10
    wxPopen.py
  • --- 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