A worker that captures outputs from methods that are run.
| 35 | |
| 36 | |
| 37 | class CaptureWorker(Worker): |
| 38 | """A worker that captures outputs from methods that are run.""" |
| 39 | |
| 40 | def __init__(self, func: Callable): |
| 41 | super().__init__(func) |
| 42 | self.outputs = None |
| 43 | |
| 44 | def run(self): |
| 45 | self.outputs = self.func() |
| 46 | self.finished.emit() |
| 47 | |
| 48 | |
| 49 | def move_to_separate_thread(func: Callable, capture_outputs: bool = False): |
no outgoing calls
no test coverage detected