OpenQuizz
Une application de gestion des contenus pédagogiques
pip._internal.utils.unpacking Namespace Reference

Functions

def current_umask ()
 
def split_leading_dir (path)
 
def has_leading_dir (paths)
 
def is_within_directory (directory, target)
 
def set_extracted_file_to_default_mode_plus_executable (path)
 
def zip_item_is_executable (info)
 
def unzip_file (filename, location, flatten=True)
 
def untar_file (filename, location)
 
def unpack_file (filename, location, content_type=None)
 

Variables

 logger
 
 SUPPORTED_EXTENSIONS
 

Detailed Description

Utilities related archives.

Function Documentation

◆ current_umask()

def pip._internal.utils.unpacking.current_umask ( )
Get the current umask which involves having to set it temporarily.

◆ has_leading_dir()

def pip._internal.utils.unpacking.has_leading_dir (   paths)
Returns true if all the paths have the same leading path name
(i.e., everything is in one subdirectory in an archive)

◆ is_within_directory()

def pip._internal.utils.unpacking.is_within_directory (   directory,
  target 
)
Return true if the absolute path of target is within the directory

◆ set_extracted_file_to_default_mode_plus_executable()

def pip._internal.utils.unpacking.set_extracted_file_to_default_mode_plus_executable (   path)
Make file present at path have execute for user/group/world
(chmod +x) is no-op on windows per python docs

◆ split_leading_dir()

def pip._internal.utils.unpacking.split_leading_dir (   path)

◆ unpack_file()

def pip._internal.utils.unpacking.unpack_file (   filename,
  location,
  content_type = None 
)

◆ untar_file()

def pip._internal.utils.unpacking.untar_file (   filename,
  location 
)
Untar the file (with path `filename`) to the destination `location`.
All files are written based on system defaults and umask (i.e. permissions
are not preserved), except that regular file members with any execute
permissions (user, group, or world) have "chmod +x" applied after being
written.  Note that for windows, any execute changes using os.chmod are
no-ops per the python docs.

◆ unzip_file()

def pip._internal.utils.unpacking.unzip_file (   filename,
  location,
  flatten = True 
)
Unzip the file (with path `filename`) to the destination `location`.  All
files are written based on system defaults and umask (i.e. permissions are
not preserved), except that regular file members with any execute
permissions (user, group, or world) have "chmod +x" applied after being
written. Note that for windows, any execute changes using os.chmod are
no-ops per the python docs.

◆ zip_item_is_executable()

def pip._internal.utils.unpacking.zip_item_is_executable (   info)

Variable Documentation

◆ logger

logger

◆ SUPPORTED_EXTENSIONS

SUPPORTED_EXTENSIONS