OpenQuizz
Une application de gestion des contenus pédagogiques
PackIndexFile Class Reference
Inheritance diagram for PackIndexFile:
Collaboration diagram for PackIndexFile:

Public Member Functions

def __init__ (self, indexpath)
 
def close (self)
 
def version (self)
 
def size (self)
 
def path (self)
 
def packfile_checksum (self)
 
def indexfile_checksum (self)
 
def offsets (self)
 
def sha_to_index (self, sha)
 
def partial_sha_to_index (self, partial_bin_sha, canonical_length)
 
def sha_to_index (self, sha)
 
- Public Member Functions inherited from LazyMixin
def __getattr__ (self, attr)
 

Static Public Attributes

 index_v2_signature
 
 index_version_default
 

Detailed Description

A pack index provides offsets into the corresponding pack, allowing to find
locations for offsets faster.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  indexpath 
)

Member Function Documentation

◆ close()

def close (   self)

◆ indexfile_checksum()

def indexfile_checksum (   self)
:return: 20 byte sha representing the sha1 hash of this index file

◆ offsets()

def offsets (   self)
:return: sequence of all offsets in the order in which they were written

**Note:** return value can be random accessed, but may be immmutable

◆ packfile_checksum()

def packfile_checksum (   self)
:return: 20 byte sha representing the sha1 hash of the pack file

◆ partial_sha_to_index()

def partial_sha_to_index (   self,
  partial_bin_sha,
  canonical_length 
)
:return: index as in `sha_to_index` or None if the sha was not found in this
    index file
:param partial_bin_sha: an at least two bytes of a partial binary sha as bytes
:param canonical_length: length of the original hexadecimal representation of the
    given partial binary sha
:raise AmbiguousObjectName:

◆ path()

def path (   self)
:return: path to the packindexfile

◆ sha_to_index() [1/2]

def sha_to_index (   self,
  sha 
)
:return: index usable with the ``offset`` or ``entry`` method, or None
    if the sha was not found in this pack index
:param sha: 20 byte sha to lookup

◆ sha_to_index() [2/2]

def sha_to_index (   self,
  sha 
)

◆ size()

def size (   self)
:return: amount of objects referred to by this index

◆ version()

def version (   self)

Field Documentation

◆ index_v2_signature

index_v2_signature
static

◆ index_version_default

index_version_default
static

The documentation for this class was generated from the following file: