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

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
 

Detailed Description

Implements an Object which may be Blobs, Trees, Commits and Tags

Constructor & Destructor Documentation

◆ __init__()

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

Member Function Documentation

◆ __eq__()

def __eq__ (   self,
  other 
)
:return: True if the objects have the same SHA1

Reimplemented in Submodule.

◆ __hash__()

def __hash__ (   self)
:return: Hash of our id allowing objects to be used in dicts and sets

Reimplemented in Submodule, and IndexObject.

◆ __ne__()

def __ne__ (   self,
  other 
)
:return: True if the objects do not have the same SHA1 

Reimplemented in Submodule.

◆ __repr__()

def __repr__ (   self)
:return: string with pythonic representation of our object

Reimplemented in Submodule.

◆ __str__()

def __str__ (   self)
:return: string of our SHA1 as understood by all git commands

Reimplemented in Submodule.

◆ data_stream()

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

◆ hexsha()

def hexsha (   self)
:return: 40 byte hex version of our 20 byte binary sha

◆ new()

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.

◆ new_from_sha()

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

◆ stream_data()

def stream_data (   self,
  ostream 
)
Writes our data directly to the given output stream
:param ostream: File object compatible stream object.
:return: self

Field Documentation

◆ binsha

binsha

◆ NULL_BIN_SHA

NULL_BIN_SHA
static

◆ NULL_HEX_SHA

NULL_HEX_SHA
static

◆ repo

repo

◆ size

size

◆ type

type
static

◆ TYPES

TYPES
static

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