Known subclasses: dulwich.objects.Blob, dulwich.objects.Commit, dulwich.objects.Tag, dulwich.objects.Tree

A git SHA file.
Method as_legacy_object_chunks Return chunks representing the object in the experimental format.
Method as_legacy_object Return string representing the object in the experimental format.
Method as_raw_chunks Return chunks with serialization of the object.
Method as_raw_string Return raw string with serialization of the object.
Method __bytes__ Return raw string serialization of this object.
Method __str__ Return raw string serialization of this object.
Method __hash__ Return unique hash for this object.
Method as_pretty_string Return a string representing this object, fit for display.
Method set_raw_string Set the contents of this object from a serialized string.
Method set_raw_chunks Set the contents of this object from a list of chunks.
Method __init__ Don't call this directly
Class Method from_path Open a SHA file from disk.
Class Method from_file Get the contents of a SHA file on disk.
Static Method from_raw_string Creates an object of the indicated type from the raw string given.
Static Method from_raw_chunks Creates an object of the indicated type from the raw chunks given.
Class Method from_string Create a ShaFile from a string.
Method check Check this object for internal consistency.
Method raw_length Returns the length of the raw string of this object.
Method sha The SHA1 object that is the name of this object.
Method copy Create a new copy of this SHA1 object from its raw string
Method id The hex SHA of this object.
Method get_type Return the type number for this object class.
Method set_type Set the type number for this object class.
Method __repr__ Undocumented
Method __ne__ Undocumented
Method __eq__ Return True if the SHAs of the two objects match.
Method __lt__ Undocumented
Method __le__ Undocumented
Method __cmp__ Undocumented
Static Method _parse_legacy_object_header Parse a legacy object, creating it but not reading the file.
Method _parse_legacy_object Parse a legacy object, setting the raw string.
Static Method _parse_object_header Parse a new style object, creating it but not reading the file.
Method _parse_object Parse a new style object, setting self._text.
Class Method _is_legacy_object Undocumented
Class Method _parse_file Undocumented
Method _deserialize Undocumented
Method _serialize Undocumented
Method _check_has_member Check that the object has a given member variable.
Method _header Undocumented
@staticmethod
def _parse_legacy_object_header(magic, f):
Parse a legacy object, creating it but not reading the file.
def _parse_legacy_object(self, map):
Parse a legacy object, setting the raw string.
def as_legacy_object_chunks(self):
Return chunks representing the object in the experimental format.
ReturnsList of strings
def as_legacy_object(self):
Return string representing the object in the experimental format.
def as_raw_chunks(self):
Return chunks with serialization of the object.
ReturnsList of strings, not necessarily one per line
def as_raw_string(self):
Return raw string with serialization of the object.
ReturnsString object
def __bytes__(self):
Return raw string serialization of this object.
def __str__(self):
Return raw string serialization of this object.
def __hash__(self):
Return unique hash for this object.
def as_pretty_string(self):
overridden in dulwich.objects.Tree
Return a string representing this object, fit for display.
def set_raw_string(self, text, sha=None):
Set the contents of this object from a serialized string.
def set_raw_chunks(self, chunks, sha=None):
Set the contents of this object from a list of chunks.
@staticmethod
def _parse_object_header(magic, f):
Parse a new style object, creating it but not reading the file.
def _parse_object(self, map):
Parse a new style object, setting self._text.
@classmethod
def _is_legacy_object(cls, magic):
Undocumented
@classmethod
def _parse_file(cls, f):
Undocumented
def __init__(self):
def _deserialize(self, chunks):
@classmethod
def from_path(cls, path):
@classmethod
def from_file(cls, f):
Get the contents of a SHA file on disk.
@staticmethod
def from_raw_string(type_num, string, sha=None):
Creates an object of the indicated type from the raw string given.
Parameterstype_numThe numeric type of the object.
stringThe raw uncompressed contents.
shaOptional known sha for the object
@staticmethod
def from_raw_chunks(type_num, chunks, sha=None):
Creates an object of the indicated type from the raw chunks given.
Parameterstype_numThe numeric type of the object.
chunksAn iterable of the raw uncompressed contents.
shaOptional known sha for the object
@classmethod
def from_string(cls, string):
Create a ShaFile from a string.
def _check_has_member(self, member, error_msg):
Check that the object has a given member variable.
Parametersmemberthe member variable to check for
error_msgthe message for an error if the member is missing
RaisesObjectFormatExceptionwith the given error_msg if member is missing or is None
def check(self):
Check this object for internal consistency.
RaisesObjectFormatExceptionif the object is malformed in some way
ChecksumMismatchif the object was created with a SHA that does not match its contents
def _header(self):
Undocumented
def raw_length(self):
Returns the length of the raw string of this object.
def sha(self):
The SHA1 object that is the name of this object.
def copy(self):
Create a new copy of this SHA1 object from its raw string
@property
def id(self):
The hex SHA of this object.
def get_type(self):
Return the type number for this object class.
def set_type(self, type):
Set the type number for this object class.
def __repr__(self):
Undocumented
def __ne__(self, other):
Undocumented
def __eq__(self, other):

Return True if the SHAs of the two objects match.

It doesn't make sense to talk about an order on ShaFiles, so we don't override the rich comparison methods (__le__, etc.).

def __lt__(self, other):
Undocumented
def __le__(self, other):
Undocumented
def __cmp__(self, other):
Undocumented
API Documentation for Dulwich, generated by pydoctor at 2018-11-17 19:05:54.