forked from IPKM/nmreval
save fit parameter does not confirm overwrite; export graphics with try-catch around get_data_opts;
This commit is contained in:
@ -596,7 +596,12 @@ class QGraphWindow(QtWidgets.QGraphicsView, Ui_GraphWindow):
|
||||
legend_shown = True
|
||||
break
|
||||
in_legend.append(legend_shown)
|
||||
item_dic = plot_item.get_data_opts()
|
||||
try:
|
||||
item_dic = plot_item.get_data_opts()
|
||||
except Exception as e:
|
||||
print(f'{item} could not exported because {e.args}')
|
||||
continue
|
||||
|
||||
if len(item) == 2:
|
||||
# plot can show errorbars
|
||||
item_dic['yerr'] = item[1].opts['topData']
|
||||
@ -607,9 +612,10 @@ class QGraphWindow(QtWidgets.QGraphicsView, Ui_GraphWindow):
|
||||
for item in self._external_items:
|
||||
try:
|
||||
dic['items'].append(item.get_data_opts())
|
||||
except AttributeError:
|
||||
print(f'{item} is missing "get_data_opts()"')
|
||||
except Exception as e:
|
||||
print(f'{item} could not be exported because {e.args}')
|
||||
continue
|
||||
|
||||
in_legend.append(False)
|
||||
|
||||
dic['in_legend'] = in_legend
|
||||
|
Reference in New Issue
Block a user