def indexFile(tree, materialPath): """ Gives the user an option to choose which file to index to the tree """ fileList = File.getFileNames(materialPath) printPath = File.printFileList(materialPath, noPath='yes') input = prompt('Choose file:', limits = [0, len(fileList)]) print 'Indexing "' + printPath[input] + '" now...' tree.lukija.clear() tree.lukija.addFileName(fileList[input]) tree.lukija.readWords() tree.addFromReader()