class documentation

Wrapper that reports progress during pack data reception.

This wrapper tracks bytes received during pack file download and periodically reports progress to match Git's behavior of showing: "Receiving objects: X% (current/total), Y MiB | Z MiB/s"

Parameters
file_writeThe underlying write function to call with received data
progressOptional progress callback to report progress messages to
report_intervalMinimum time between progress reports in seconds (default 0.5)
report_byte_thresholdMinimum bytes between progress reports (default 1 MiB)
Method __call__ Called with each chunk of pack data.
Method __init__ Undocumented
Method finalize Report final progress with a newline.
Instance Variable bytes_received Undocumented
Instance Variable file_write Undocumented
Instance Variable header_buffer Undocumented
Instance Variable header_parsed Undocumented
Instance Variable last_report_bytes Undocumented
Instance Variable last_report_time Undocumented
Instance Variable progress Undocumented
Instance Variable report_byte_threshold Undocumented
Instance Variable report_interval Undocumented
Instance Variable start_time Undocumented
Instance Variable total_objects Undocumented
Method _parse_header Parse the pack file header to extract the total object count.
Method _report_progress Generate and send a progress message.
def __call__(self, data: bytes) -> int:

Called with each chunk of pack data.

def __init__(self, file_write: Callable[[bytes], int], progress: Callable[[bytes], None] | None, report_interval: float = 0.5, report_byte_threshold: int = 1024 * 1024):

Undocumented

def finalize(self):

Report final progress with a newline.

bytes_received: int =

Undocumented

file_write =

Undocumented

header_buffer: bytes =

Undocumented

header_parsed: bool =

Undocumented

last_report_bytes =

Undocumented

last_report_time =

Undocumented

progress =

Undocumented

report_byte_threshold =

Undocumented

report_interval =

Undocumented

start_time =

Undocumented

total_objects: int | None =

Undocumented

def _parse_header(self):

Parse the pack file header to extract the total object count.

def _report_progress(self):

Generate and send a progress message.