1
0
forked from IPKM/nmreval

better check for valid class and argument names in fit function creation

This commit is contained in:
Dominik Demuth 2023-08-06 16:41:22 +02:00
parent 2fed4bb0bf
commit 783fe505ba

View File

@ -14,7 +14,7 @@ from gui_qt.lib.namespace import QNamespaceWidget
__all__ = ['QUserFitCreator'] __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) pattern = re.compile(r'def func\(.*\):', flags=re.MULTILINE)
@ -145,6 +145,7 @@ class QUserFitCreator(QtWidgets.QDialog, Ui_Dialog):
self.classCreated.emit() self.classCreated.emit()
super().accept() super().accept()
class KwargsWidget(QtWidgets.QWidget): class KwargsWidget(QtWidgets.QWidget):
Changed = QtCore.pyqtSignal() Changed = QtCore.pyqtSignal()