"""Compute sha256 hashes for all files""" import os import pooch def append_file(source_file_path, destination_file_path): """Append contents of source file into destination file.""" # Read the contents of the source file with open(source_file_path, "r") as source_file: source_contents = source_file.read() # Open the destination file in append mode and write with open(destination_file_path, "a") as destination_file: destination_file.write(source_contents) def main(): folders = ["ml-runs", "04.09.2023-04-Right_RE_test_3_frames"] destination_file = "files-registry.txt" for folder in folders: # write registry for current folder in temporary file pooch.make_registry(folder, f"out_{folder}") # append temporary file to destination file append_file(f"out_{folder}", destination_file) # remove temporary file os.remove(f"out_{folder}") if __name__ == "__main__": main()