class ProgressProcess(multiprocessing.Process):
    def __init__(self, comm_queue, qtapp = None, **kwargs):
        multiprocessing.Process.__init__(self)
        self.comm_queue = comm_queue
        self.kwargs = kwargs
        
        self.closed_cleanly = None
        print qtapp
        
        if qtapp:
            self.app = qtapp
            self.appExist = True
            print("Using existing app")
        else:
            self.app = None
            self.appExist = False
        
    def run(self):
        if not self.app:
            self.app = QtGui.QApplication(sys.argv)
        
        self.window = ProgressWindow(comm_queue = self.comm_queue, **self.kwargs)
        self.window.show()
        
        if not self.appExist:
            return(self.app.exec_())
        else:
            return(0)
 def run(self):
     if not self.app:
         self.app = QtGui.QApplication(sys.argv)
     
     self.window = ProgressWindow(comm_queue = self.comm_queue, **self.kwargs)
     self.window.show()
     
     if not self.appExist:
         return(self.app.exec_())
     else:
         return(0)