(self, cancelled=False)
| 151 | raise NotImplementedError |
| 152 | |
| 153 | def cancelInstall(self, cancelled=False): |
| 154 | self.cancelled = True |
| 155 | if not cancelled: |
| 156 | MCSL2Logger.warning("试图关闭 ForgeInstaller...") |
| 157 | if self.workingProcess is not None: |
| 158 | self.workingProcess.kill() |
| 159 | self._cancelTimer.setSingleShot(True) |
| 160 | self._cancelTimer.timeout.connect(lambda: self.cancelInstall(True)) # 设置超时时间 |
| 161 | else: |
| 162 | MCSL2Logger.error(msg="关闭 ForgeInstaller 超时,正在强制关闭...") |
| 163 | self.workingProcess.kill() |
| 164 | self._cancelTimer.stop() |
| 165 | self._cancelTimer.deleteLater() |
| 166 | |
| 167 | def _installerLogHandler(self, prefix: str = ""): |
| 168 | newData = self.workingProcess.readAllStandardOutput().data() |
no test coverage detected