equal
deleted
inserted
replaced
79 |
79 |
80 self.Proc = subprocess.Popen(self.Command, |
80 self.Proc = subprocess.Popen(self.Command, |
81 cwd = os.getcwd(), |
81 cwd = os.getcwd(), |
82 stdin = subprocess.PIPE, |
82 stdin = subprocess.PIPE, |
83 stdout = subprocess.PIPE, |
83 stdout = subprocess.PIPE, |
84 stderr = subprocess.STDOUT, |
84 #stderr = subprocess.STDOUT, |
|
85 stderr = subprocess.PIPE, |
85 startupinfo = self.startupinfo) |
86 startupinfo = self.startupinfo) |
86 # stderr = subprocess.PIPE) |
87 |
87 |
88 |
88 self.outt = outputThread( |
89 self.outt = outputThread( |
89 self.Proc, |
90 self.Proc, |
90 self.Proc.stdout, |
91 self.Proc.stdout, |
91 self.output, |
92 self.output, |
92 self.finish) |
93 self.finish) |
93 |
94 |
94 self.outt.start() |
95 self.outt.start() |
95 |
96 |
96 # self.errt = outputThread( |
97 self.errt = outputThread( |
97 # self.Proc, |
98 self.Proc, |
98 # self.Proc.stderr, |
99 self.Proc.stderr, |
99 # self.errors) |
100 self.errors) |
100 # |
101 # |
101 # self.errt.start() |
102 self.errt.start() |
102 |
103 |
103 def output(self,v): |
104 def output(self,v): |
104 self.outdata += v |
105 self.outdata += v |
105 self.outlen += 1 |
106 self.outlen += 1 |
106 if not self.no_stdout: |
107 if not self.no_stdout: |
121 if self.finish_callback is not None: |
122 if self.finish_callback is not None: |
122 self.finish_callback(self,ecode,pid) |
123 self.finish_callback(self,ecode,pid) |
123 |
124 |
124 def kill(self): |
125 def kill(self): |
125 self.outt.killed = True |
126 self.outt.killed = True |
126 # self.errt.killed = True |
127 self.errt.killed = True |
127 if wx.Platform == '__WXMSW__': |
128 if wx.Platform == '__WXMSW__': |
128 PROCESS_TERMINATE = 1 |
129 PROCESS_TERMINATE = 1 |
129 handle = ctypes.windll.kernel32.OpenProcess(PROCESS_TERMINATE, False, self.Proc.pid) |
130 handle = ctypes.windll.kernel32.OpenProcess(PROCESS_TERMINATE, False, self.Proc.pid) |
130 ctypes.windll.kernel32.TerminateProcess(handle, -1) |
131 ctypes.windll.kernel32.TerminateProcess(handle, -1) |
131 ctypes.windll.kernel32.CloseHandle(handle) |
132 ctypes.windll.kernel32.CloseHandle(handle) |