forked from IPKM/nmreval
saving removes bad characters
This commit is contained in:
parent
af313c7a58
commit
0eb0a4be77
@ -578,16 +578,16 @@ class QGraphWindow(QtWidgets.QGraphicsView, Ui_GraphWindow):
|
||||
|
||||
if suffix == '.pdf':
|
||||
from ..io.exporters import PDFPrintExporter
|
||||
PDFPrintExporter(self.graphic).export(outfile)
|
||||
PDFPrintExporter(self.graphic).export(str(outfile))
|
||||
|
||||
elif suffix == '.svg':
|
||||
from pyqtgraph.exporters import SVGExporter
|
||||
SVGExporter(self.scene).export(outfile)
|
||||
SVGExporter(self.scene).export(str(outfile))
|
||||
|
||||
else:
|
||||
from pyqtgraph.exporters import ImageExporter
|
||||
|
||||
ImageExporter(self.scene).export(outfile)
|
||||
ImageExporter(self.scene).export(str(outfile))
|
||||
|
||||
self.set_color(foreground=fg_color, background=bg_color)
|
||||
|
||||
|
@ -114,7 +114,7 @@ class NMRMainWindow(QtWidgets.QMainWindow, Ui_BaseWindow):
|
||||
|
||||
self.datawidget.management = self.management
|
||||
self.integralwidget.management = self.management
|
||||
# self.drawingswidget.graphs = self.management.graphs
|
||||
self.drawingswidget.graphs = self.management.graphs
|
||||
|
||||
self.ac_group = QtWidgets.QActionGroup(self)
|
||||
self.ac_group.addAction(self.action_lm_fit)
|
||||
@ -126,8 +126,6 @@ class NMRMainWindow(QtWidgets.QMainWindow, Ui_BaseWindow):
|
||||
self.ac_group2.addAction(self.action_x_range)
|
||||
self.ac_group2.addAction(self.action_custom_range)
|
||||
|
||||
self.action_draw_object.setVisible(False)
|
||||
|
||||
def _init_signals(self):
|
||||
self.actionRedo = self.management.undostack.createRedoAction(self)
|
||||
icon = QtGui.QIcon.fromTheme("edit-redo")
|
||||
@ -268,6 +266,10 @@ class NMRMainWindow(QtWidgets.QMainWindow, Ui_BaseWindow):
|
||||
|
||||
param_outfile = re.sub('[_\s-]?<label>[_\s-]?', '', savefile.stem)
|
||||
|
||||
bad_character = r'/*<>\|:"'
|
||||
for c in bad_character:
|
||||
param_outfile = param_outfile.replace(c, '')
|
||||
|
||||
if save_dialog.agr_cb.isChecked():
|
||||
self.current_graph_widget.export(savefile.with_name(param_outfile + '.agr'))
|
||||
|
||||
@ -598,8 +600,9 @@ class NMRMainWindow(QtWidgets.QMainWindow, Ui_BaseWindow):
|
||||
|
||||
def _select_drawingswidget(self, onoff):
|
||||
if onoff:
|
||||
self.drawingswidget(self.management.graphs.list())
|
||||
self.drawingswidget.connected_figure = self.management.current_graph
|
||||
if self.drawingswidget.graphs is None:
|
||||
self.drawingswidget.graphs = self.management.graphs
|
||||
self.drawingswidget.update_tree()
|
||||
else:
|
||||
self.drawingswidget.clear()
|
||||
|
||||
|
@ -1116,7 +1116,12 @@ class UpperManagement(QtCore.QObject):
|
||||
else:
|
||||
real_outnames.append(full_name)
|
||||
|
||||
outpath_set = path.with_name(real_outnames[-1]+path.suffix)
|
||||
out_name = real_outnames[-1]
|
||||
bad_character = r'/*<>\|:"'
|
||||
for c in bad_character:
|
||||
out_name = out_name.replace(c, '')
|
||||
|
||||
outpath_set = path.with_name(out_name+path.suffix)
|
||||
data_i.save(outpath_set)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user