Ejemplo n.º 1
0
    def run(self):
        """This is the method that is called when the thread is started
        """

        self.__result = None

        self.__exception = None

        if self.__thread_method != None:

            try:
                self.__result = self.__thread_method(*self.__thread_args)
            except Exception,e:
                if debug.is_debugging():
                    raise
                else:
                    self.__exception = e
                    self.__traceback = traceback.format_exc()
Ejemplo n.º 2
0
                    raise
                else:
                    self.__exception = e
                    self.__traceback = traceback.format_exc()

    def get_result(self):
        """Return the result, that was returned by the last thread method
        """

        self.wait_safe()

        return self.__result



if 'PyQt4.QtCore' in sys.modules and not debug.is_debugging():
    from PyQt4.QtCore import *

    class Thread(QThread, AbstractThreadBase):

        __thread_support__ = True

        def __init__(self, *args, **kwargs):
            super(Thread, self).__init__(*args, **kwargs)
            #QThread.__init__(self)
            self.mutex = QMutex()
            self.stop_running = False

        def stop(self):
            self.mutex.lock()
            self.stop_running = True