46 Zeilen
1.1 KiB
Python
46 Zeilen
1.1 KiB
Python
"""
|
|
Safe imports for platform controllers.
|
|
Provides fallback when PyQt5 is not available during testing.
|
|
"""
|
|
|
|
try:
|
|
from PyQt5.QtCore import QObject, QThread, pyqtSignal
|
|
PYQT5_AVAILABLE = True
|
|
except ImportError:
|
|
# Fallback for testing without PyQt5
|
|
class QObject:
|
|
def __init__(self):
|
|
pass
|
|
|
|
class QThread(QObject):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.running = True
|
|
|
|
def start(self):
|
|
pass
|
|
|
|
def stop(self):
|
|
self.running = False
|
|
|
|
def isRunning(self):
|
|
return self.running
|
|
|
|
def quit(self):
|
|
self.running = False
|
|
|
|
def wait(self):
|
|
pass
|
|
|
|
def pyqtSignal(*args, **kwargs):
|
|
"""Mock pyqtSignal for testing"""
|
|
class MockSignal:
|
|
def connect(self, func):
|
|
pass
|
|
def emit(self, *args):
|
|
pass
|
|
return MockSignal()
|
|
|
|
PYQT5_AVAILABLE = False
|
|
|
|
__all__ = ['QObject', 'QThread', 'pyqtSignal', 'PYQT5_AVAILABLE'] |