class documentation
class PackStreamCopier(PackStreamReader):
Constructor: PackStreamCopier(hash_func, read_all, read_some, outfile, ...)
Class to verify a pack stream as it is being read.
The pack is read from a ReceivableProtocol using read() or recv() as appropriate and written out to the given file-like object.
| Method | __init__ |
Initialize the copier. |
| Method | verify |
Verify a pack stream and write it to the output file. |
| Instance Variable | outfile |
Undocumented |
| Method | _read |
Read data from the read callback and write it to the file. |
| Instance Variable | _delta |
Undocumented |
Inherited from PackStreamReader:
| Method | __len__ |
Return the number of objects in this pack. |
| Method | read |
Read, blocking until size bytes are read. |
| Method | read |
Read the objects in this pack file. |
| Method | recv |
Read up to size bytes, blocking until one byte is read. |
| Instance Variable | hash |
Undocumented |
| Instance Variable | read |
Undocumented |
| Instance Variable | read |
Undocumented |
| Instance Variable | sha |
Undocumented |
| Property | offset |
Return current offset in the stream. |
| Method | _buf |
Undocumented |
| Instance Variable | _hash |
Undocumented |
| Instance Variable | _num |
Undocumented |
| Instance Variable | _offset |
Undocumented |
| Instance Variable | _rbuf |
Undocumented |
| Instance Variable | _trailer |
Undocumented |
| Instance Variable | _zlib |
Undocumented |
def __init__(self, hash_func:
Callable[ [], HashObject], read_all: Callable[ [ int], bytes], read_some: Callable[ [ int], bytes] | None, outfile: IO[ bytes], delta_iter: DeltaChainIterator[ UnpackedObject] | None = None):
¶
overrides
dulwich.pack.PackStreamReader.__init__Initialize the copier.
| Parameters | |
hashCallable[ | Hash function to use for computing object IDs |
readCallable[ | Read function that blocks until the number of requested bytes are read. |
readCallable[ | Read function that returns at least one byte, but may not return the number of bytes requested. |
outfile:IO[ | File-like object to write output through. |
deltaDeltaChainIterator[ | Optional DeltaChainIterator to record deltas as we read them. |
Verify a pack stream and write it to the output file.
See PackStreamReader.iterobjects for a list of exceptions this may throw.
overrides
dulwich.pack.PackStreamReader._readRead data from the read callback and write it to the file.