b.g.GroupCompressBlock(object) : class documentation

Part of bzrlib.groupcompress View In Hierarchy

An object which maintains the internal structure of the compressed data.

This tracks the meta info (start of text, length, type, etc.)

Method __init__ Undocumented
Method __len__ Undocumented
Class Method from_bytes Undocumented
Method extract Extract the text for a specific key.
Method set_chunked_content Set the content of this block to the given chunks.
Method set_content Set the content of this block.
Method to_chunks Create the byte stream as a series of 'chunks'
Method to_bytes Encode the information into a byte stream.
Method _ensure_content Make sure that content has been expanded enough.
Method _parse_bytes Read the various lengths from the header.
Method _z_content Return z_content_chunks as a simple string.
Method _create_z_content_using_lzma Undocumented
Method _create_z_content_from_chunks Undocumented
Method _create_z_content Undocumented
Method _dump Take this block, and spit out a human-readable structure.
def __init__(self):
Undocumented
def __len__(self):
Undocumented
def _ensure_content(self, num_bytes=None):
Make sure that content has been expanded enough.
Parametersnum_bytesEnsure that we have extracted at least num_bytes of content. If None, consume everything
def _parse_bytes(self, bytes, pos):
Read the various lengths from the header.

This also populates the various 'compressed' buffers.

ReturnsThe position in bytes just after the last newline
@property
def _z_content(self):
Return z_content_chunks as a simple string.

Meant only to be used by the test suite.

@classmethod
def from_bytes(cls, bytes):
Undocumented
def extract(self, key, start, end, sha1=None):
Extract the text for a specific key.
ParameterskeyThe label used for this content
sha1TODO (should we validate only when sha1 is supplied?)
ReturnsThe bytes for the content
def set_chunked_content(self, content_chunks, length):
Set the content of this block to the given chunks.
def set_content(self, content):
Set the content of this block.
def _create_z_content_using_lzma(self):
Undocumented
def _create_z_content_from_chunks(self, chunks):
Undocumented
def _create_z_content(self):
Undocumented
def to_chunks(self):
Create the byte stream as a series of 'chunks'
def to_bytes(self):
Encode the information into a byte stream.
def _dump(self, include_text=False):
Take this block, and spit out a human-readable structure.
Parametersinclude_textInserts also include text bits, chose whether you want this displayed in the dump or not.
ReturnsA dump of the given block. The layout is something like: [('f', length), ('d', delta_length, text_length, [delta_info])] delta_info := [('i', num_bytes, text), ('c', offset, num_bytes), ...]
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.