class documentation
class UnpackedObject:
Constructor: UnpackedObject(pack_type_num, delta_base, decomp_len, crc32, ...)
Class encapsulating an object unpacked from a pack file.
These objects should only be created from within unpack_object. Most members start out as empty and are filled in at various points by read_zlib_chunks, unpack_object, DeltaChainIterator, etc.
End users of this object should take care that the function they're getting this object from is guaranteed to set the members they need.
| Method | __eq__ |
Check equality with another UnpackedObject. |
| Method | __init__ |
Initialize an UnpackedObject. |
| Method | __ne__ |
Check inequality with another UnpackedObject. |
| Method | __repr__ |
Return string representation of this UnpackedObject. |
| Method | sha |
Return the binary SHA of this object. |
| Method | sha |
Return a ShaFile from this object. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | comp |
Undocumented |
| Instance Variable | crc32 |
Undocumented |
| Instance Variable | decomp |
Undocumented |
| Instance Variable | decomp |
Undocumented |
| Instance Variable | delta |
Undocumented |
| Instance Variable | hash |
Undocumented |
| Instance Variable | obj |
Undocumented |
| Instance Variable | obj |
Undocumented |
| Instance Variable | offset |
Undocumented |
| Instance Variable | pack |
Undocumented |
| Method | _obj |
Return the decompressed chunks, or (delta base, delta chunks). |
| Instance Variable | _sha |
Undocumented |
def __init__(self, pack_type_num:
int, *, delta_base: None | bytes | int = None, decomp_len: int | None = None, crc32: int | None = None, sha: bytes | None = None, decomp_chunks: list[ bytes] | None = None, offset: int | None = None, hash_func: Callable[ [], HashObject] = sha1):
¶
Initialize an UnpackedObject.
| Parameters | |
packint | Type number of this object in the pack |
deltaNone | bytes | int | Delta base (offset or SHA) if this is a delta object |
decompint | None | Decompressed length of this object |
crc32:int | None | CRC32 checksum |
sha:bytes | None | SHA hash of the object |
decomplist[ | Decompressed chunks |
offset:int | None | Offset in the pack file |
hashCallable[ | Hash function to use (defaults to sha1) |