natcap.invest.ui.execution¶
A class for a Qt-enabled python Thread.
-
class
natcap.invest.ui.execution.Executor(target, args=None, kwargs=None, log_events=True)¶ Bases:
MockQObject,threading.ThreadA thread of control that will emit a Qt signal when finished.
-
finished= <MagicMock name='mock.QtCore.Signal()' id='140194456148528'>¶
-
run()¶ Run the target callable in a separate thread of control.
The callable will be run with whatever
argsandkwargsare provided to the thread’s__init__method.If an exception is encountered while executing the target, several things happen:
The exception is logged.
self.failedis set toTrue.self.exceptionrefers to the exception object that was raised.self.tracebackrefers to the formatted traceback.
Finally, the signal
self.finishedis emitted, regardless of whether an exception was raised.
-