MCPcopy Create free account
hub / github.com/MCSLTeam/MCSL2 / cancelInstall

Method cancelInstall

MCSL2Lib/ServerControllers/serverInstaller.py:153–165  ·  view source on GitHub ↗
(self, cancelled=False)

Source from the content-addressed store, hash-verified

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()

Callers 2

cancelInstallMethod · 0.45
cancelInstallMethod · 0.45

Calls 3

warningMethod · 0.80
stopMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected