def onExtractTxtFile( self ): srcPath = QFileDialog.getOpenFileName( caption='Text file to extract from?', directory=dbsPath ) if not srcPath: return destPath = QFileDialog.getSaveFileName( caption='Save morpheme db to?', directory=dbsPath + os.sep + 'textFile.db' ) if not destPath: return mat = cfg1('text file import maturity') db = MorphDb.mkFromFile( str(srcPath), mat ) if db: db.save( str(destPath) ) infoMsg( 'Extracted successfully' )
def onExtractTxtFile( self ): srcPath = QFileDialog.getOpenFileName( caption='Text file to extract from?', directory=dbsPath ) if not srcPath: return destPath = QFileDialog.getSaveFileName( caption='Save morpheme db to?', directory=dbsPath + os.sep + 'textFile.db' ) if not destPath: return mat = cfg1('text file import maturity') db = MorphDb.mkFromFile( str(srcPath), getAllMorphemizers()[self.morphemizerComboBox.currentIndex()], mat ) if db: db.save( str(destPath) ) infoMsg( 'Extracted successfully' )