(self)
| 70 | self.output_stream.push(text) |
| 71 | |
| 72 | def stop(self): |
| 73 | if not self.is_finished(): |
| 74 | if not os_utils.is_win(): |
| 75 | group_id = os.getpgid(self.get_process_id()) |
| 76 | os.killpg(group_id, signal.SIGTERM) |
| 77 | |
| 78 | class KillChildren(object): |
| 79 | def finished(self): |
| 80 | try: |
| 81 | os.killpg(group_id, signal.SIGKILL) |
| 82 | except ProcessLookupError: |
| 83 | # probably there are no children left |
| 84 | pass |
| 85 | |
| 86 | self.add_finish_listener(KillChildren()) |
| 87 | |
| 88 | else: |
| 89 | self.process.terminate() |
| 90 | |
| 91 | self._write_script_output('\n>> STOPPED BY USER\n') |
| 92 | |
| 93 | def kill(self): |
| 94 | if not self.is_finished(): |
nothing calls this directly
no test coverage detected