def printChoices(files):
    """Returns the choosen fileInfo object.

    files -- CKAN_API.FileInfo object list
    """
    print('\nChoose wich file to download: ')
    print(
        'Warning: English versions should be prefered due to parsing issues.\n'
        )
    limit = len(files)
    for i in range(0, limit):
        print('\t {0}. {1} ( {2} ) : {3}'.format(i + 1, files[i].get_name(),
            files[i].get_language(), files[i].get_format()))
    print('')
    choice, quit = None, False
    while quit is False and choice is None:
        choice = input('Enter file number to download (or q to quit): ')
        if choice.lower() == 'q':
            quit = True
        else:
            try:
                choice = int(choice)
                assert choice > 0 and choice <= limit
            except:
                print('Invalid choice.')
                choice = None
    return None if quit else files[choice - 1]
