collected_associated_files = []
invalid_files = []
for algorithm in IMAGE_BUILDER_ALGORITHMS:
new_images, new_associated_image_files, new_invalid_files = \
algorithm(tmp_dir)
collected_images += new_images
collected_associated_files += new_associated_image_files
invalid_files += list(new_invalid_files.keys())
for used_file in new_associated_image_files:
filename = used_file.file.name
After Change
algorithm_result: ImageBuilderResult
collected_images += list(algorithm_result.new_images)
collected_associated_files += \
list(algorithm_result.new_image_files)
for filename in algorithm_result.consumed_files:
if filename in unconsumed_filenames:
unconsumed_filenames.remove(filename)