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

Public Member Functions

def has_object (self, sha)
 
def info (self, sha)
 
def stream (self, sha)
 
def size (self)
 
def sha_iter (self)
 
def databases (self)
 
def update_cache (self, force=False)
 
def partial_to_complete_sha_hex (self, partial_hexsha)
 
- Public Member Functions inherited from ObjectDBR
def __contains__ (self, sha)
 
- Public Member Functions inherited from LazyMixin
def __getattr__ (self, attr)
 

Detailed Description

A database which delegates calls to sub-databases.

Databases are stored in the lazy-loaded _dbs attribute.
Define _set_cache_ to update it with your databases

Member Function Documentation

◆ databases()

def databases (   self)
:return: tuple of database instances we use for lookups

◆ 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.

◆ partial_to_complete_sha_hex()

def partial_to_complete_sha_hex (   self,
  partial_hexsha 
)
:return: 20 byte binary sha1 from the given less-than-40 byte hexsha (bytes or str)
:param partial_hexsha: hexsha with less than 40 byte
:raise AmbiguousObjectName: 

◆ 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: total size of all contained databases

Reimplemented from ObjectDBR.

◆ stream()

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

Reimplemented from ObjectDBR.

◆ update_cache()

def update_cache (   self,
  force = False 
)
Call this method if the underlying data changed to trigger an update
of the internal caching structures.

:param force: if True, the update must be performed. Otherwise the implementation
    may decide not to perform an update if it thinks nothing has changed.
:return: True if an update was performed as something change indeed

Reimplemented from CachingDB.

Reimplemented in ReferenceDB.


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