Esempio n. 1
0
 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")
Esempio n. 2
0
 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")
Esempio n. 3
0
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()
Esempio n. 4
0
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()
Esempio n. 5
0
def test_creator_save():
    mysave = SaveFile([FILENAMEDATA], FILEDATA_OUT, np.array([[[1, 2], [1, 3], [3, 4]]]), [1, 2])
    mysave.save()
Esempio n. 6
0
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()
Esempio n. 7
0
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()
Esempio n. 8
0
def test_wrong_filterlandmarks():
    with pytest.raises(IndexError) as excinfo:
        mysave = SaveFile([FILENAMEDATA], FILEDATA_OUT,
                          np.array([[1, 2], [1, 3], [3, 4]]), [4, 5])
Esempio n. 9
0
def test_creator_save():
    mysave = SaveFile([FILENAMEDATA], FILEDATA_OUT,
                      np.array([[[1, 2], [1, 3], [3, 4]]]), [1, 2])
    mysave.save()