OpenQuizz
Une application de gestion des contenus pédagogiques
|
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) |
![]() | |
def | root_path (self) |
def | db_path (self, rela_path) |
![]() | |
def | __contains__ (self, sha) |
![]() | |
def | __init__ (self, *args, **kwargs) |
def | ostream (self) |
Static Public Attributes | |
stream_chunk_size | |
new_objects_mode | |
A database which operates on loose object files
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.
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.
Reimplemented in GitCmdObjectDB.
def object_path | ( | self, | |
hexsha | |||
) |
:return: path at which the object with the given hexsha would be stored, relative to the database root
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.
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
def set_ostream | ( | self, | |
stream | |||
) |
:raise TypeError: if the stream does not support the Sha1Writer interface
Reimplemented from ObjectDBW.
def sha_iter | ( | self | ) |
Return iterator yielding 20 byte shas for all objects in this data base
Reimplemented from ObjectDBR.
def size | ( | self | ) |
:return: amount of objects in this database
Reimplemented from ObjectDBR.
def store | ( | self, | |
istream | |||
) |
note: The sha we produce will be hex by nature
Reimplemented from ObjectDBW.
def stream | ( | self, | |
sha | |||
) |
:return: OStream instance :param sha: 20 bytes binary sha :raise BadObject:
Reimplemented from ObjectDBR.
Reimplemented in GitCmdObjectDB.
|
static |
|
static |