Initial commit
Dieser Commit ist enthalten in:
46
controllers/platform_controllers/safe_imports.py
Normale Datei
46
controllers/platform_controllers/safe_imports.py
Normale Datei
@ -0,0 +1,46 @@
|
||||
"""
|
||||
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']
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren