Try to ignore _process variable

This commit is contained in:
Ian Paschal 2018-07-10 11:04:17 +02:00
parent de551ccf51
commit d709650def

View file

@ -249,7 +249,7 @@ class CuraEngineBackend(QObject, Backend):
if self._application.getPrintInformation() and build_plate_to_be_sliced == active_build_plate: if self._application.getPrintInformation() and build_plate_to_be_sliced == active_build_plate:
self._application.getPrintInformation().setToZeroPrintInformation(build_plate_to_be_sliced) self._application.getPrintInformation().setToZeroPrintInformation(build_plate_to_be_sliced)
if self._process is None: if self._process is None: # type: ignore
self._createSocket() self._createSocket()
self.stopSlicing() self.stopSlicing()
self._engine_is_fresh = False # Yes we're going to use the engine self._engine_is_fresh = False # Yes we're going to use the engine
@ -287,12 +287,12 @@ class CuraEngineBackend(QObject, Backend):
if self._application.getUseExternalBackend(): if self._application.getUseExternalBackend():
return return
if self._process is not None: if self._process is not None: # type: ignore
Logger.log("d", "Killing engine process") Logger.log("d", "Killing engine process")
try: try:
self._process.terminate() self._process.terminate() # type: ignore
Logger.log("d", "Engine process is killed. Received return code %s", self._process.wait()) Logger.log("d", "Engine process is killed. Received return code %s", self._process.wait()) # type: ignore
self._process = None self._process = None # type: ignore
except Exception as e: # terminating a process that is already terminating causes an exception, silently ignore this. except Exception as e: # terminating a process that is already terminating causes an exception, silently ignore this.
Logger.log("d", "Exception occurred while trying to kill the engine %s", str(e)) Logger.log("d", "Exception occurred while trying to kill the engine %s", str(e))
@ -786,9 +786,9 @@ class CuraEngineBackend(QObject, Backend):
# We should reset our state and start listening for new connections. # We should reset our state and start listening for new connections.
def _onBackendQuit(self) -> None: def _onBackendQuit(self) -> None:
if not self._restart: if not self._restart:
if self._process: if self._process: # type: ignore
Logger.log("d", "Backend quit with return code %s. Resetting process and socket.", self._process.wait()) Logger.log("d", "Backend quit with return code %s. Resetting process and socket.", self._process.wait()) # type: ignore
self._process = None self._process = None # type: ignore
## Called when the global container stack changes ## Called when the global container stack changes
def _onGlobalStackChanged(self) -> None: def _onGlobalStackChanged(self) -> None: