VL iWdZddlmZddlmZmZdZGddeZGddeZ Gd d e Z Gd d eZ Gd de Z Gdde Z Gdde ZGddeZGddeZGddeZy)zPModule with basic data structures - they are designed to be lightweight and fast bin_to_hex)type_id_to_type_maptype_to_type_id_map) OInfo OPackInfoODeltaPackInfoOStream OPackStreamODeltaPackStreamIStream InvalidOInfoInvalidOStreamczeZdZdZeZdZdZedZ edZ edZ edZ edZ y ) raCarries information about an object in an ODB, providing information about the binary sha of the object, the type_string as well as the uncompressed size in bytes. It can be accessed using tuple notation and using attribute access notation:: assert dbi[0] == dbi.binsha assert dbi[1] == dbi.type assert dbi[2] == dbi.size The type is designed to be as lightweight as possible.c4tj||||fSNtuple__new__)clsshatypesizes P/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/gitdb/base.pyrz OInfo.__new__#s}}S3d"344c.tj|yrr__init__selfargss rrzOInfo.__init__& trc |dS)z$:return: our sha as binary, 20 bytesrr s rbinshaz OInfo.binsha* Awrct|dSz':return: our sha, hex encoded, 40 bytesrrr%s rhexshaz OInfo.hexsha/$q'""rc |dSNr$r%s rrz OInfo.type4 Awrct|dSr-)rr%s rtype_idz OInfo.type_id8"47++rc |dSNr$r%s rrz OInfo.size<r/rN)__name__ __module__ __qualname____doc__r __slots__rrpropertyr&r*rr1rr$rrrrs~ >I5##,,rrcjeZdZdZeZdZdZedZ edZ edZ edZ y) ra`As OInfo, but provides a type_id property to retrieve the numerical type id, and does not include a sha. Additionally, the pack_offset is the absolute offset into the packfile at which all object information is located. The data_offset property points to the absolute location in the pack at which that actual data stream can be found.c4tj||||fSrr)r packoffsetrrs rrzOPackInfo.__new__Ls}}S:tT":;;rc.tj|yrrrs rrzOPackInfo.__init__Or"rc |dSNrr$r%s r pack_offsetzOPackInfo.pack_offsetTr/rct|dSr-)rr%s rrzOPackInfo.typeXr2rc |dSr-r$r%s rr1zOPackInfo.type_id\r/rc |dSr4r$r%s rrzOPackInfo.size`r/rN) r6r7r8r9rr:rrr;rBrr1rr$rrrrBskK I< ,,rrc4eZdZdZeZdZedZy)r zAdds delta specific information, Either the 20 byte sha which points to some object in the database, or the negative offset from the pack_offset, so that pack_offset - delta_info yields the pack offset of the base objectc6tj|||||fSrr)rr>rr delta_infos rrzODeltaPackInfo.__new__os}}S:tT:"FGGrc |dSNr$r%s rrHzODeltaPackInfo.delta_infosr/rN) r6r7r8r9rr:rr;rHr$rrr r gs**IHrr cBeZdZdZeZdZdZddZe dZ y)r zBase for object streams retrieved from the database, providing additional information about the stream. Generally, ODB streams are read-only as objects are immutablec6tj|||||fSz+Helps with the initialization of subclassesrrrrrstreamr!kwargss rrzOStream.__new__}}S3dF";<rrrPr!s rrzOPackStream.__new__s}}S:tT6"BCCrc*|dj|SrJrUrWs rrVzOPackStream.readrXrc |dSrJr$r%s rrPzOPackStream.streamr/rNrZ r6r7r8r9rr:rrVr;rPr$rrr r s-ID "rr c<eZdZdZeZdZddZedZ y)r zFProvides a stream outputting the uncompressed offset delta informationc8tj||||||fSrr)rr>rrrHrPs rrzODeltaPackStream.__new__s}}S:tT:v"NOOrc*|dj|SNrUrWs rrVzODeltaPackStream.readrXrc |dSrhr$r%s rrPzODeltaPackStream.streamr/rNrZrdr$rrr r s+PIP"rr ceZdZdZeZddZddZedZ dZ dZ ee e Z ddZ d Zd ZeeeZd Zd ZeeeZd ZdZeeeZdZdZeeeZy)r agRepresents an input content stream to be fed into the ODB. It is mutable to allow the ODB to record information about the operations outcome right in this instance. It provides interfaces for the OStream and a StreamReader to allow the instance to blend in without prior conversion. The only method your content stream must support is 'read'Nc8tj|||||dfSr)listr)rrrrPrs rrzIStream.__new__s||C#tT64!@AArc:tj|||||dfyr)rmr)r rrrPrs rrzIStream.__init__s dS$fd;rs W!  8*E*\  JY$e4 7 ")(~$L,dL,b56\r