- if self.handle is None:
- if platform.system() == "Darwin" and hasattr(sys, 'frozen'):
- cmdList = [os.path.join(os.path.dirname(sys.executable), 'Cura')]
- else:
- cmdList = [sys.executable, '-m', 'Cura.cura']
- cmdList.append('-r')
- cmdList.append(filename)
- if platform.system() == "Darwin":
- if platform.machine() == 'i386':
- cmdList.insert(0, 'arch')
- cmdList.insert(1, '-i386')
- self.handle = subprocess.Popen(cmdList, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- self.thread = threading.Thread(target=self.Monitor)
- self.thread.start()
+ if self.handle is None or not self.handle.is_alive():
+ if self.handle is not None:
+ self.handle.join()
+ self.handle = multiprocessing.Process(target=startPrintInterface, args=(filename, self.queue))
+ self.handle.start()