From 185dd160f14dde6ac03650235737eda82177657c Mon Sep 17 00:00:00 2001 From: Dominik Demuth Date: Mon, 30 Oct 2023 19:34:18 +0100 Subject: [PATCH] fix import of agr with missing legends --- src/gui_qt/io/gracereader.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui_qt/io/gracereader.py b/src/gui_qt/io/gracereader.py index ca1e414..987bed8 100644 --- a/src/gui_qt/io/gracereader.py +++ b/src/gui_qt/io/gracereader.py @@ -56,8 +56,12 @@ class QGraceReader(QtWidgets.QDialog, Ui_Dialog): if ds is None: continue - item_2 = QtWidgets.QTreeWidgetItem([f'Set {gset.idx} (Label: {convert(gset.get_property("legend"), old="agr", new="str")}, ' + legend = gset.get_property('legend') + legend_str = convert(legend, old='agr', new='str') if legend is not None else '' + + item_2 = QtWidgets.QTreeWidgetItem([f'Set {gset.idx} (Label: {legend_str}, ' f'shape: {ds.shape})']) + item_2.setCheckState(0, QtCore.Qt.Checked) item_2.setData(0, QtCore.Qt.UserRole, (graphs.idx, gset.idx)) item.addChild(item_2)