OpenQuizz
Une application de gestion des contenus pédagogiques
|
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) |
![]() | |
def | __contains__ (self, sha) |
![]() | |
def | __getattr__ (self, attr) |
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
def databases | ( | self | ) |
:return: tuple of database instances we use for lookups
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.
def info | ( | self, | |
sha | |||
) |
:return: OInfo instance :param sha: bytes binary sha :raise BadObject:
Reimplemented from ObjectDBR.
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:
def sha_iter | ( | self | ) |
Return iterator yielding 20 byte shas for all objects in this data base
Reimplemented from ObjectDBR.
def size | ( | self | ) |
:return: total size of all contained databases
Reimplemented from ObjectDBR.
def stream | ( | self, | |
sha | |||
) |
:return: OStream instance :param sha: 20 bytes binary sha :raise BadObject:
Reimplemented from ObjectDBR.
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.