def __deliver(frames, count, client): """ Creates an Archive of Collected Frames. Sends that Archive :param frames: :param client: :return: """ img_zip = Archive(str(count) + ".zip") file_name = img_zip.file_name for frame in frames: img_zip.add(frame) print(f"{frame} added") # deleting files once added to zip if os.path.exists(frame): os.remove(frame) else: print(f"{frame} does not exist") # sending frames to server img_zip.close() client.send_file(img_zip.file_name) os.remove(file_name)
def deliver(frames, archive_num, client) -> None: """ Creates an Archive of Collected Frames. Sends that Archive :param frames: Collection of frames being passed :param archive_num: The number of the archive being passed (1-10) :param client: The CLERN FDS client :return: """ img_zip = Archive(str(archive_num) + ".zip") file_name = img_zip.file_name for frame in frames: img_zip.add(frame) print(f"{frame} added") # deleting files once added to zip if os.path.exists(frame): os.remove(frame) else: print(f"{frame} does not exist") # sending frames to server img_zip.close() client.send_file(img_zip.file_name) os.remove(file_name)