b.p.ContainerWriter(object) : class documentation

Part of bzrlib.pack View In Hierarchy

A class for writing containers to a file.
Unknown Field: attributerecords_writtenThe number of user records added to the container. This does not count the prelude or suffix of the container introduced by the begin() and end() methods.
Method __init__ Constructor.
Method begin Begin writing a container.
Method write_func Undocumented
Method end Finish writing a container.
Method add_bytes_record Add a Bytes record with the given names.
def __init__(self, write_func):
Constructor.
Parameterswrite_funca callable that will be called when this ContainerWriter needs to write some bytes.
def begin(self):
Begin writing a container.
def write_func(self, bytes):
Undocumented
def end(self):
Finish writing a container.
def add_bytes_record(self, bytes, names):
Add a Bytes record with the given names.
ParametersbytesThe bytes to insert.
namesThe names to give the inserted bytes. Each name is a tuple of bytestrings. The bytestrings may not contain whitespace.
ReturnsAn offset, length tuple. The offset is the offset of the record within the container, and the length is the length of data that will need to be read to reconstitute the record. These offset and length can only be used with the pack interface - they might be offset by headers or other such details and thus are only suitable for use by a ContainerReader.
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.