forked from Support/sp-hydra-veil-gui
16 lines
412 B
Python
Executable file
16 lines
412 B
Python
Executable file
from typing import Callable
|
|
|
|
from PyQt6.QtCore import QThread, pyqtSignal
|
|
|
|
from gui.v2.actions.menu_results import MenuCallback, MenuResult
|
|
|
|
|
|
class Worker(QThread):
|
|
output = pyqtSignal(object)
|
|
|
|
def __init__(self, operation: Callable[[MenuCallback], MenuResult]):
|
|
super().__init__()
|
|
self.operation = operation
|
|
|
|
def run(self):
|
|
self.output.emit(self.operation(self.output.emit))
|