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

Public Member Functions

def __init__ (self, root_path)
 
def object_path (self, hexsha)
 
def readable_db_object_path (self, hexsha)
 
def partial_to_complete_sha_hex (self, partial_hexsha)
 
def set_ostream (self, stream)
 
def info (self, sha)
 
def stream (self, sha)
 
def has_object (self, sha)
 
def store (self, istream)
 
def sha_iter (self)
 
def size (self)
 
- Public Member Functions inherited from FileDBBase
def root_path (self)
 
def db_path (self, rela_path)
 
- Public Member Functions inherited from ObjectDBR
def __contains__ (self, sha)
 
- Public Member Functions inherited from ObjectDBW
def __init__ (self, *args, **kwargs)
 
def ostream (self)
 

Static Public Attributes

 stream_chunk_size
 
 new_objects_mode
 

Detailed Description

A database which operates on loose object files

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  root_path 
)
Initialize this instance to look for its files at the given root path
All subsequent operations will be relative to this path
:raise InvalidDBRoot:
**Note:** The base will not perform any accessablity checking as the base
    might not yet be accessible, but become accessible before the first
    access.

Reimplemented from FileDBBase.

Member Function Documentation

◆ has_object()

def has_object (   self,
  sha 
)
:return: True if the object identified by the given 20 bytes
    binary sha is contained in the database

Reimplemented from ObjectDBR.

◆ info()

def info (   self,
  sha 
)
:return: OInfo instance
:param sha: bytes binary sha
:raise BadObject:

Reimplemented from ObjectDBR.

Reimplemented in GitCmdObjectDB.

◆ object_path()

def object_path (   self,
  hexsha 
)
:return: path at which the object with the given hexsha would be stored,
    relative to the database root

◆ partial_to_complete_sha_hex()

def partial_to_complete_sha_hex (   self,
  partial_hexsha 
)
:return: 20 byte binary sha1 string which matches the given name uniquely
:param name: hexadecimal partial name (bytes or ascii string)
:raise AmbiguousObjectName:
:raise BadObject: 

Reimplemented in GitCmdObjectDB.

◆ readable_db_object_path()

def readable_db_object_path (   self,
  hexsha 
)
:return: readable object path to the object identified by hexsha
:raise BadObject: If the object file does not exist

◆ set_ostream()

def set_ostream (   self,
  stream 
)
:raise TypeError: if the stream does not support the Sha1Writer interface

Reimplemented from ObjectDBW.

◆ sha_iter()

def sha_iter (   self)
Return iterator yielding 20 byte shas for all objects in this data base

Reimplemented from ObjectDBR.

◆ size()

def size (   self)
:return: amount of objects in this database

Reimplemented from ObjectDBR.

◆ store()

def store (   self,
  istream 
)
note: The sha we produce will be hex by nature

Reimplemented from ObjectDBW.

◆ stream()

def stream (   self,
  sha 
)
:return: OStream instance
:param sha: 20 bytes binary sha
:raise BadObject:

Reimplemented from ObjectDBR.

Reimplemented in GitCmdObjectDB.

Field Documentation

◆ new_objects_mode

new_objects_mode
static

◆ stream_chunk_size

stream_chunk_size
static

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