def onEntry(self, event): dialog = QtGui.QFileDialog() savefilename = dialog.getSaveFileName( self.window, "Save File", os.getcwd(), "Files (*.txt *.tps *.xls *.cvs)") try: mysavefile = SaveFile(self.window.myfinder.filenames, savefilename, self.window.myfinder.landmarks, self.window.number_of_landmarks) mysavefile.save() except IOError, exc: logging.error(exc.message, exc_info=True) QtGui.QMessageBox.warning( self.window, "Warning", "You have to choose a filename for the output")
def onEntry(self, event): dialog = QtGui.QFileDialog() savefilename = dialog.getSaveFileName(self.window, "Save File", os.getcwd(), "Files (*.txt *.tps *.xls *.cvs)") try: mysavefile = SaveFile( self.window.myfinder.filenames, savefilename, self.window.myfinder.landmarks, self.window.number_of_landmarks) mysavefile.save() except IOError, exc: logging.error(exc.message, exc_info=True) QtGui.QMessageBox.warning(self.window, "Warning", "You have to choose a filename for the output")
def test_empty_extension(): with pytest.raises(IOError) as excinfo: mysave = SaveFile([FILENAMEDATA], "", np.array([[[1, 2], [1, 3], [3, 4]]]), [1, 2]) mysave.save()
def test_wrong_extension(): with pytest.raises(NoExtensionKnowException) as excinfo: mysave = SaveFile([FILENAMEDATA], FILEDATA_OUT_WRONG, np.array([[[1, 2], [1, 3], [3, 4]]]), [1, 2]) mysave.save()
def test_creator_save(): mysave = SaveFile([FILENAMEDATA], FILEDATA_OUT, np.array([[[1, 2], [1, 3], [3, 4]]]), [1, 2]) mysave.save()