def _saveModel(self):
        delimiter = self._delimiterBox.currentSelected()
        header = self._headerCheckBox.isChecked() # column labels
        filename = self._filenameLineEdit.text()
        index = False # row labels

        encodingIndex = self._encodingComboBox.currentIndex()
        encoding = self._encodingComboBox.itemText(encodingIndex)
        encoding = _calculateEncodingKey(encoding.lower())

        try:
            dataFrame = self._model.dataFrame()
        except AttributeError, err:
            raise AttributeError('No data loaded to export.')
        else:
            try:
                dataFrame.to_csv(filename, encoding=encoding, header=header, index=index, sep=delimiter)
            except __HOLE__, err:
                raise IOError('No filename given')
            except UnicodeError, err:
                raise UnicodeError('Could not encode all data. Choose a different encoding')
            except Exception:
                raise
dataset/ETHPy150Open datalyze-solutions/pandas-qt/pandasqt/views/CSVDialogs.py/CSVExportDialog._saveModel