forked from Support/sp-hydra-veil-gui
24 lines
783 B
Python
Executable file
24 lines
783 B
Python
Executable file
import importlib
|
|
|
|
from PyQt6.QtCore import QThread, pyqtSignal
|
|
|
|
|
|
class PageDataWorker(QThread):
|
|
data_ready = pyqtSignal(str, object)
|
|
failed = pyqtSignal(str, str)
|
|
|
|
def __init__(self, name, module_path, class_name, custom_window):
|
|
super().__init__()
|
|
self.name = name
|
|
self.module_path = module_path
|
|
self.class_name = class_name
|
|
self.custom_window = custom_window
|
|
|
|
def run(self):
|
|
try:
|
|
module = importlib.import_module(self.module_path)
|
|
cls = getattr(module, self.class_name)
|
|
payload = cls.prepare_data(self.custom_window)
|
|
self.data_ready.emit(self.name, payload)
|
|
except Exception as error:
|
|
self.failed.emit(self.name, f"{type(error).__name__}: {error}")
|