Пример #1
0
    def start(self):
        # Unload cyclone
        self.stop()

        # Stock the current state of python import and rollback it if try to restart the AppServer
        self.rollbackImporter = RollbackImporter()
        from vt_as_cyclone import CycloneThread

        self.appThread = CycloneThread(self.parent())

        # Use this signal from the thread to indicate the thread exited
        QObject.connect(self.appThread, SIGNAL("runFinished(PyQt_PyObject)"),
                        self.stop)
        QObject.connect(self.appThread, SIGNAL("runStatus(PyQt_PyObject)"),
                        self.stop)
        QObject.connect(self.appThread, SIGNAL("runError(PyQt_PyObject)"),
                        self.stop)

        self.appThread.start()

        self.timer = QTimer()
        QObject.connect(self.timer, SIGNAL("timeout()"), self.yield_thread)
        self.timer.start(10)