#HACK: Set the paint function of the glCanvas to nothing so it won't keep refreshing. Which keeps wxWidgets from quiting.
print "Closing down"
self.scene.OnPaint = lambda e : e
+ self.scene._slicer.cleanup()
self.Destroy()
def OnQuit(self, e):
self._progressSteps = ['inset', 'skin', 'export']
self._objCount = 0
+ def cleanup(self):
+ self.abortSlicer()
+ os.remove(self._binaryStorageFilename)
+ os.remove(self._exportFilename)
+
def abortSlicer(self):
if self._process is not None:
self._process.terminate()
progressValue /= self._objCount
progressValue += 1.0 / self._objCount * objectNr
- self._callback(progressValue, False)
+ try:
+ self._callback(progressValue, False)
+ except:
+ pass
else:
print '#', line.strip()
line = self._process.stdout.readline()
print line.strip()
returnCode = self._process.wait()
print returnCode
- if returnCode == 0:
- self._callback(1.0, True)
- else:
- self._callback(0.0, False)
+ try:
+ if returnCode == 0:
+ self._callback(1.0, True)
+ else:
+ self._callback(0.0, False)
+ except:
+ pass
self._process = None
def _engineSettings(self):