import glob


def parse_folder(path, raster_ext):
    """
    Returns a list with all raster files in a folder

    Parameters
    ----------
    path: string
        Path to folder with raster files
    raster_ext: string
        specifies raster format

    Returns
    -------
    raster_file_list: list
        list of all raster files in a folder
    raster_file_name: list
        list of all raster names in a folder
    """
    print('\n##########   -   Searching for files   -   ##########')
    raster_file_list = []
    raster_file_name = []

    # parsing folder for files
    for file in glob.glob(path + "*" + raster_ext):
        raster_file_list.append(file)
        raster_file_list = [w.replace('\\', '/') for w in raster_file_list]
        raster_file_name = [w[len(path):1000] for w in raster_file_list]

    return raster_file_list, raster_file_name