class documentation
class PackChunkGenerator:
Constructor: PackChunkGenerator(object_format, num_records, records, progress, ...)
Generator for pack data chunks.
| Method | __init__ |
Initialize PackChunkGenerator. |
| Method | __iter__ |
Iterate over pack data chunks. |
| Method | sha1digest |
Return the SHA1 digest of the pack data. |
| Instance Variable | cs |
Undocumented |
| Instance Variable | entries |
Undocumented |
| Instance Variable | object |
Undocumented |
| Method | _pack |
Iterate pack data file chunks. |
| Instance Variable | _it |
Undocumented |
def __init__(self, object_format:
ObjectFormat, num_records: int | None = None, records: Iterator[ UnpackedObject] | None = None, progress: Callable[ ..., None] | None = None, compression_level: int = -1, reuse_compressed: bool = True):
¶
Initialize PackChunkGenerator.
| Parameters | |
objectObjectFormat | Object format (hash algorithm) to use |
numint | None | Expected number of records |
records:Iterator[ | Iterator of pack records |
progress:Callable[ | Optional progress callback |
compressionint | Compression level (-1 for default) |
reusebool | Whether to reuse compressed chunks |
def _pack_data_chunks(self, records:
Iterator[ UnpackedObject], *, num_records: int | None = None, progress: Callable[ ..., None] | None = None, compression_level: int = -1, reuse_compressed: bool = True) -> Iterator[ bytes]:
¶
Iterate pack data file chunks.
Returns: Dict mapping id -> (offset, crc32 checksum), pack checksum
| Parameters | |
records:Iterator[ | Iterator over UnpackedObject |
numint | None | Number of records (defaults to len(records) if not specified) |
progress:Callable[ | Function to report progress to |
compressionint | the zlib compression level |
reusebool | Whether to reuse compressed chunks |
| Returns | |
Iterator[ | Undocumented |