From 783fe505ba68ab7016e8bace63076b6a1def29ef Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Sun, 6 Aug 2023 16:41:22 +0200 Subject: [PATCH] better check for valid class and argument names in fit function creation --- src/gui_qt/fit/function_creation_dialog.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui_qt/fit/function_creation_dialog.py b/src/gui_qt/fit/function_creation_dialog.py index 4c104bd..41d9363 100644 --- a/src/gui_qt/fit/function_creation_dialog.py +++ b/src/gui_qt/fit/function_creation_dialog.py @@ -14,7 +14,7 @@ from gui_qt.lib.namespace import QNamespaceWidget __all__ = ['QUserFitCreator'] -validator = QtGui.QRegExpValidator(QtCore.QRegExp('[A-Za-z]\S*')) +validator = QtGui.QRegExpValidator(QtCore.QRegExp('[_A-Za-z][_A-Za-z0-9]*')) pattern = re.compile(r'def func\(.*\):', flags=re.MULTILINE) @@ -145,6 +145,7 @@ class QUserFitCreator(QtWidgets.QDialog, Ui_Dialog): self.classCreated.emit() super().accept() + class KwargsWidget(QtWidgets.QWidget): Changed = QtCore.pyqtSignal()