Skip to content

Commit 3bfb6c9

Browse files
committed
Revert removed comments.
1 parent 7546ab1 commit 3bfb6c9

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

src/ml_flashpoint/checkpoint_object_manager/buffer_metadata.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020

2121
class BufferMetadataType(ctypes.LittleEndianStructure):
22-
"""Metadata block stored at the beginning of the BufferIO buffer."""
22+
"""Defines the structure of the metadata block stored at the beginning
23+
of the BufferIO buffer.
24+
"""
2325

2426
_pack_ = 1 # Ensure tight packing for cross-platform consistency
2527
_fields_ = [
@@ -43,5 +45,19 @@ class BufferMetadataType(ctypes.LittleEndianStructure):
4345

4446
# --- Helper Function ---
4547
def get_metadata_str(metadata: BufferMetadataType | None) -> str:
46-
"""Returns a string representation of the BufferMetadataType object."""
47-
return f"Metadata(len_written_data={metadata.len_written_data})" if metadata else "[Metadata: None]"
48+
"""Returns a string representation of the BufferMetadataType object.
49+
50+
Args:
51+
metadata: An instance of BufferMetadataType or None.
52+
53+
Returns:
54+
A formatted string describing the metadata content, or a placeholder
55+
if metadata is None.
56+
"""
57+
if metadata is None:
58+
return "[Metadata: None]"
59+
# Format the fields from the metadata object
60+
# Add more fields here if the BufferMetadataType struct expands
61+
len_data = metadata.len_written_data
62+
# You could add other relevant fields from 'reserved' if they were defined
63+
return f"Metadata(len_written_data={len_data})"

0 commit comments

Comments
 (0)