equal
deleted
inserted
replaced
129 self.Proc, |
129 self.Proc, |
130 self.Proc.stderr, |
130 self.Proc.stderr, |
131 self.errors) |
131 self.errors) |
132 self.errt.start() |
132 self.errt.start() |
133 |
133 |
134 Timer(timeout,self.endlog).start() |
134 if timeout: |
|
135 self.timeout = Timer(timeout,self.endlog) |
|
136 self.timeout.start() |
|
137 else: |
|
138 self.timeout = None |
135 |
139 |
136 def output(self,v): |
140 def output(self,v): |
137 self.outdata.append(v) |
141 self.outdata.append(v) |
138 self.outlen += 1 |
142 self.outlen += 1 |
139 if not self.no_stdout: |
143 if not self.no_stdout: |
152 def log_the_end(self,ecode,pid): |
156 def log_the_end(self,ecode,pid): |
153 self.logger.write(self.Command_str + "\n") |
157 self.logger.write(self.Command_str + "\n") |
154 self.logger.write_warning(_("exited with status %s (pid %s)\n")%(str(ecode),str(pid))) |
158 self.logger.write_warning(_("exited with status %s (pid %s)\n")%(str(ecode),str(pid))) |
155 |
159 |
156 def finish(self, pid,ecode): |
160 def finish(self, pid,ecode): |
|
161 if self.timeout: self.timeout.cancel() |
157 self.exitcode = ecode |
162 self.exitcode = ecode |
158 if self.exitcode != 0: |
163 if self.exitcode != 0: |
159 self.log_the_end(ecode,pid) |
164 self.log_the_end(ecode,pid) |
160 if self.finish_callback is not None: |
165 if self.finish_callback is not None: |
161 self.finish_callback(self,ecode,pid) |
166 self.finish_callback(self,ecode,pid) |