OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, repo, binsha) |
def | new (cls, repo, id) |
def | new_from_sha (cls, repo, sha1) |
def | __eq__ (self, other) |
def | __ne__ (self, other) |
def | __hash__ (self) |
def | __str__ (self) |
def | __repr__ (self) |
def | hexsha (self) |
def | data_stream (self) |
def | stream_data (self, ostream) |
Data Fields | |
repo | |
binsha | |
size | |
Static Public Attributes | |
NULL_HEX_SHA | |
NULL_BIN_SHA | |
TYPES | |
type | |
Implements an Object which may be Blobs, Trees, Commits and Tags
def __init__ | ( | self, | |
repo, | |||
binsha | |||
) |
Initialize an object by identifying it by its binary sha. All keyword arguments will be set on demand if None. :param repo: repository this object is located in :param binsha: 20 byte SHA1
def __eq__ | ( | self, | |
other | |||
) |
:return: True if the objects have the same SHA1
Reimplemented in Submodule.
def __hash__ | ( | self | ) |
:return: Hash of our id allowing objects to be used in dicts and sets
Reimplemented in Submodule, and IndexObject.
def __ne__ | ( | self, | |
other | |||
) |
:return: True if the objects do not have the same SHA1
Reimplemented in Submodule.
def __repr__ | ( | self | ) |
:return: string with pythonic representation of our object
Reimplemented in Submodule.
def __str__ | ( | self | ) |
:return: string of our SHA1 as understood by all git commands
Reimplemented in Submodule.
def data_stream | ( | self | ) |
:return: File Object compatible stream to the uncompressed raw data of the object :note: returned streams must be read in order
def hexsha | ( | self | ) |
:return: 40 byte hex version of our 20 byte binary sha
def new | ( | cls, | |
repo, | |||
id | |||
) |
:return: New Object instance of a type appropriate to the object type behind id. The id of the newly created object will be a binsha even though the input id may have been a Reference or Rev-Spec :param id: reference, rev-spec, or hexsha :note: This cannot be a __new__ method as it would always call __init__ with the input id which is not necessarily a binsha.
def new_from_sha | ( | cls, | |
repo, | |||
sha1 | |||
) |
:return: new object instance of a type appropriate to represent the given binary sha1 :param sha1: 20 byte binary sha1
def stream_data | ( | self, | |
ostream | |||
) |
Writes our data directly to the given output stream :param ostream: File object compatible stream object. :return: self
binsha |
|
static |
|
static |
repo |
size |
|
static |
|
static |