def match_all_from_file_to_file(file, write_file): print("starting...") all_locations = read_all_from_disk(file) total_locations = len(all_locations) print("matching "+str(total_locations)+" locations...") all_details = [] for index, location in enumerate(all_locations): print("getting details for location: "+str(index+1)+"/"+str(total_locations)) details = find_details_from_location(location) details.insert(0, location.name) all_details.append(details) print("writing to disk...") write_to_file(write_file, all_details) print("done.")
def update_data(read_from, write_to): all_locations = read_all_from_disk(read_from) updated_locations = [] for location in all_locations: updated_locations.append(update_one_location(location)) write_all_locations_to_disk(updated_locations, write_to)