diff --git a/src/gui_qt/data/point_select.py b/src/gui_qt/data/point_select.py index 514ba49..512e5e8 100644 --- a/src/gui_qt/data/point_select.py +++ b/src/gui_qt/data/point_select.py @@ -199,4 +199,4 @@ class PointSelectWidget(QtWidgets.QWidget, Ui_Form): @QtCore.pyqtSlot(int, name='on_graph_checkbox_stateChanged') def changed_state(self, checked): - self.graph_combobox.setEnabled(checked!=QtCore.Qt.Checked) + self.graph_combobox.setEnabled(checked != QtCore.Qt.Checked) diff --git a/src/gui_qt/io/asciireader.py b/src/gui_qt/io/asciireader.py index b6e78de..8cbbd37 100644 --- a/src/gui_qt/io/asciireader.py +++ b/src/gui_qt/io/asciireader.py @@ -211,7 +211,7 @@ class QAsciiReader(QtWidgets.QDialog, Ui_ascii_reader): col_header.append(i) if y is not None and col_header is not None: - col_header = [col_header[i] for i in range(len(col_header)) if i in y] + col_header = [col_header[i] for i in range(len(col_header))] try: ret_dic = self.reader.export( diff --git a/src/gui_qt/main/mainwindow.py b/src/gui_qt/main/mainwindow.py index 6af00a7..8e439a2 100644 --- a/src/gui_qt/main/mainwindow.py +++ b/src/gui_qt/main/mainwindow.py @@ -259,8 +259,11 @@ class NMRMainWindow(QtWidgets.QMainWindow, Ui_BaseWindow): filedialog.set_graphs(self.management.graphs.list()) - filedialog.exec() - fname = filedialog.selectedFiles() + accepted = filedialog.exec() + if accepted: + fname = filedialog.selectedFiles() + else: + fname = [] if fname: self.path = Path(fname[0]).parent diff --git a/src/nmreval/io/asciireader.py b/src/nmreval/io/asciireader.py index 6e9ceb3..e8c0b4f 100644 --- a/src/nmreval/io/asciireader.py +++ b/src/nmreval/io/asciireader.py @@ -121,6 +121,9 @@ class AsciiReader: if y is None: y = list(range(int(len(x) != 0), max(self.width))) + if col_names is not None: + col_names = [col_names[y_i] for y_i in y] + cols = x + y + yerr with self.fname.open('rb') as fh: tmp_ = re.sub(b'[;,]', b' ', fh.read())