From 25dc29b63300101a35732a31c1841cd8f7596cad Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Tue, 20 Feb 2024 17:16:08 +0100 Subject: [PATCH 1/2] fix #249 --- src/gui_qt/io/asciireader.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui_qt/io/asciireader.py b/src/gui_qt/io/asciireader.py index a4c9524..2520844 100644 --- a/src/gui_qt/io/asciireader.py +++ b/src/gui_qt/io/asciireader.py @@ -38,7 +38,7 @@ class QAsciiReader(QtWidgets.QDialog, Ui_ascii_reader): self.changestaggeredrange(0) self.ascii_table.contextMenuEvent = self.ctx_table - self.ascii_table.horizontalHeader().setContextMenuPolicy(QtCore.Qt.CustomContextMenu) + self.ascii_table.horizontalHeader().setContextMenuPolicy(QtCore.Qt.ContextMenuPolicy.CustomContextMenu) self.ascii_table.horizontalHeader().customContextMenuRequested.connect(self.ctx_table) self.skip = False @@ -65,7 +65,7 @@ class QAsciiReader(QtWidgets.QDialog, Ui_ascii_reader): self.set_column_names(1) self.skippy_checkbox.blockSignals(True) - self.skippy_checkbox.setCheckState(QtCore.Qt.Unchecked) + self.skippy_checkbox.setCheckState(QtCore.Qt.CheckState.Unchecked) self.skippy_checkbox.blockSignals(False) return self @@ -232,7 +232,7 @@ class QAsciiReader(QtWidgets.QDialog, Ui_ascii_reader): @QtCore.pyqtSlot(int, name='on_buttonGroup_buttonClicked') def show_error(self, val: int): - self.deltay_lineEdit.setEnabled(val == -3) + self.deltay_lineEdit.setEnabled(val == -2) @QtCore.pyqtSlot(int, name='on_skippy_checkbox_stateChanged') def skip_next_dial(self, _: int): -- 2.39.5 From 43f86a6c29367cbd2184da510ecf8ec1692e6d94 Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Tue, 20 Feb 2024 17:17:44 +0100 Subject: [PATCH 2/2] handle mixed space and tabs --- src/nmreval/io/asciireader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nmreval/io/asciireader.py b/src/nmreval/io/asciireader.py index 05f84a5..6a31318 100644 --- a/src/nmreval/io/asciireader.py +++ b/src/nmreval/io/asciireader.py @@ -49,7 +49,7 @@ class AsciiReader: with self.fname.open('r') as f: for i, line in enumerate(islice(f, len(self.header)+len(self.lines), num_lines)): line = line.strip('\n\t\r, ') - line = re.sub(r'[\t ;,] *', ';', line) + line = re.sub(r'[\t ;,]+', ';', line) line = line.split(';') try: -- 2.39.5