0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-14 03:31:50 +02:00

fix(error_popups): SafeProperty logger import fixed

This commit is contained in:
2025-01-16 11:22:14 +01:00
parent 6cd7ff6ef7
commit b40d2c5f0b

View File

@ -6,6 +6,8 @@ from bec_lib.logger import bec_logger
from qtpy.QtCore import Property, QObject, Qt, Signal, Slot from qtpy.QtCore import Property, QObject, Qt, Signal, Slot
from qtpy.QtWidgets import QApplication, QMessageBox, QPushButton, QVBoxLayout, QWidget from qtpy.QtWidgets import QApplication, QMessageBox, QPushButton, QVBoxLayout, QWidget
logger = bec_logger.logger
def SafeProperty(prop_type, *prop_args, popup_error: bool = False, default=None, **prop_kwargs): def SafeProperty(prop_type, *prop_args, popup_error: bool = False, default=None, **prop_kwargs):
""" """
@ -41,7 +43,7 @@ def SafeProperty(prop_type, *prop_args, popup_error: bool = False, default=None,
# Return the user-defined default (which might be anything, including None). # Return the user-defined default (which might be anything, including None).
else: else:
error_msg = traceback.format_exc() error_msg = traceback.format_exc()
bec_logger.error(error_msg) logger.error(str(error_msg))
return default return default
class PropertyWrapper: class PropertyWrapper:
@ -62,7 +64,7 @@ def SafeProperty(prop_type, *prop_args, popup_error: bool = False, default=None,
# Swallow the exception; no crash in Designer # Swallow the exception; no crash in Designer
else: else:
error_msg = traceback.format_exc() error_msg = traceback.format_exc()
bec_logger.error(error_msg) logger.error(str(error_msg))
return return
# Return the full read/write Property # Return the full read/write Property