def get_csvs(path, fbs, wells): """Function to find the correct csv files and get their base names.""" search = Directory(path) csvs = sorted(search.get_all_files('*.ome.csv')) for csv_path in csvs: csv_file = File(csv_path) # Get the filebase from the csv path. fbase = csv_file.cut_path('C\d\d.+$') # Get the well from the csv path. well_name = csv_file.get_name('U\d\d--V\d\d') fbs.append(fbase) wells.append(well_name) return {'wells':wells, 'bases':fbs}