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

Public Member Functions

def __init__ (self, repo, binsha, mode=None, path=None)
 
def __hash__ (self)
 
def name (self)
 
def abspath (self)
 
- Public Member Functions inherited from Object
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 __str__ (self)
 
def __repr__ (self)
 
def hexsha (self)
 
def data_stream (self)
 
def stream_data (self, ostream)
 

Data Fields

 mode
 
 path
 
- Data Fields inherited from Object
 repo
 
 binsha
 
 size
 

Additional Inherited Members

- Static Public Attributes inherited from Object
 NULL_HEX_SHA
 
 NULL_BIN_SHA
 
 TYPES
 
 type
 

Detailed Description

Base for all objects that can be part of the index file , namely Tree, Blob and
SubModule objects

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  repo,
  binsha,
  mode = None,
  path = None 
)
Initialize a newly instanced IndexObject

:param repo: is the Repo we are located in
:param binsha: 20 byte sha1
:param mode:
    is the stat compatible file mode as int, use the stat module
    to evaluate the information
:param path:
    is the path to the file in the file system, relative to the git repository root, i.e.
    file.ext or folder/other.ext
:note:
    Path may not be set of the index object has been created directly as it cannot
    be retrieved without knowing the parent tree.

Reimplemented in Tree.

Member Function Documentation

◆ __hash__()

def __hash__ (   self)
:return:
    Hash of our path as index items are uniquely identifiable by path, not
    by their data !

Reimplemented from Object.

Reimplemented in Submodule.

◆ abspath()

def abspath (   self)
:return:
    Absolute path to this index object in the file system ( as opposed to the
    .path field which is a path relative to the git repository ).

    The returned path will be native to the system and contains '\' on windows. 

◆ name()

def name (   self)
:return: Name portion of the path, effectively being the basename

Reimplemented in Submodule.

Field Documentation

◆ mode

mode

◆ path

path

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