From a9aef889f5bc059adf43ce65fe3758eb14b1bf4f Mon Sep 17 00:00:00 2001 From: "Mark S. Bentley" Date: Mon, 2 Dec 2024 17:38:16 +0100 Subject: [PATCH] Set object_length if present in the collection inventory --- pds4_utils/write.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pds4_utils/write.py b/pds4_utils/write.py index 23f21b3..d78cc4b 100755 --- a/pds4_utils/write.py +++ b/pds4_utils/write.py @@ -86,6 +86,7 @@ def set_if_exists(root, xpath, value): # write the filename, checksum and number of records into the template set_if_exists(root, '/pds:Product_Collection/pds:File_Area_Inventory/pds:Inventory/pds:records', len(index)) + set_if_exists(root, '/pds:Product_Collection/pds:File_Area_Inventory/pds:Inventory/pds:object_length', os.path.getsize(csv_file)) set_if_exists(root, '/pds:Product_Collection/pds:File_Area_Inventory/pds:File/pds:records', len(index)) set_if_exists(root, '/pds:Product_Collection/pds:File_Area_Inventory/pds:File/pds:file_name', collection_csv) set_if_exists(root, '/pds:Product_Collection/pds:File_Area_Inventory/pds:File/pds:md5_checksum', common.md5_hash(csv_file))