OpenQuizz
Une application de gestion des contenus pédagogiques
git.util Namespace Reference

Data Structures

class  Actor
 
class  BlockingLockFile
 
class  CallableRemoteProgress
 
class  IndexFileSHA1Writer
 
class  Iterable
 
class  IterableList
 
class  LockFile
 
class  NullHandler
 
class  RemoteProgress
 
class  Stats
 

Functions

def unbare_repo (func)
 
def cwd (new_dir)
 
def rmtree (path)
 
def rmfile (path)
 
def stream_copy (source, destination, chunk_size=512 *1024)
 
def join_path (a, *p)
 
def to_native_path_windows (path)
 
def to_native_path_linux (path)
 
def join_path_native (a, *p)
 
def assure_directory_exists (path, is_file=False)
 
def py_where (program, path=None)
 
def cygpath (path)
 See: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx and: https://www.cygwin.com/cygwin-ug-net/using.html#unc-paths. More...
 
def decygpath (path)
 
def is_cygwin_git (git_executable)
 
def get_user_id ()
 
def finalize_process (proc, **kwargs)
 
def expand_path (p, expand_vars=True)
 

Variables

 log
 
 HIDE_WINDOWS_KNOWN_ERRORS
 
 HIDE_WINDOWS_FREEZE_ERRORS
 
 to_native_path
 

Function Documentation

◆ assure_directory_exists()

def git.util.assure_directory_exists (   path,
  is_file = False 
)
Assure that the directory pointed to by path exists.

:param is_file: If True, path is assumed to be a file and handled correctly.
    Otherwise it must be a directory
:return: True if the directory was created, False if it already existed

◆ cwd()

def git.util.cwd (   new_dir)

◆ cygpath()

def git.util.cygpath (   path)

See: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx and: https://www.cygwin.com/cygwin-ug-net/using.html#unc-paths.

Use :meth:`git.cmd.Git.polish_url()` instead, that works on any environment.

◆ decygpath()

def git.util.decygpath (   path)

◆ expand_path()

def git.util.expand_path (   p,
  expand_vars = True 
)

◆ finalize_process()

def git.util.finalize_process (   proc,
**  kwargs 
)
Wait for the process (clone, fetch, pull or push) and handle its errors accordingly

◆ get_user_id()

def git.util.get_user_id ( )
:return: string identifying the currently active system user as name@node

◆ is_cygwin_git()

def git.util.is_cygwin_git (   git_executable)

◆ join_path()

def git.util.join_path (   a,
p 
)
Join path tokens together similar to osp.join, but always use
'/' instead of possibly '\' on windows.

◆ join_path_native()

def git.util.join_path_native (   a,
p 
)
As join path, but makes sure an OS native path is returned. This is only
    needed to play it safe on my dear windows and to assure nice paths that only
    use '\'

◆ py_where()

def git.util.py_where (   program,
  path = None 
)

◆ rmfile()

def git.util.rmfile (   path)
Ensure file deleted also on *Windows* where read-only files need special treatment.

◆ rmtree()

def git.util.rmtree (   path)
Remove the given recursively.

:note: we use shutil rmtree but adjust its behaviour to see whether files that
    couldn't be deleted are read-only. Windows will not remove them in that case

◆ stream_copy()

def git.util.stream_copy (   source,
  destination,
  chunk_size = 512 * 1024 
)
Copy all data from the source stream into the destination stream in chunks
of size chunk_size

:return: amount of bytes written

◆ to_native_path_linux()

def to_native_path_linux (   path)

◆ to_native_path_windows()

def git.util.to_native_path_windows (   path)

◆ unbare_repo()

def git.util.unbare_repo (   func)
Methods with this decorator raise InvalidGitRepositoryError if they
encounter a bare repository

Variable Documentation

◆ HIDE_WINDOWS_FREEZE_ERRORS

HIDE_WINDOWS_FREEZE_ERRORS

◆ HIDE_WINDOWS_KNOWN_ERRORS

HIDE_WINDOWS_KNOWN_ERRORS

◆ log

log

◆ to_native_path

to_native_path