OpenQuizz
Une application de gestion des contenus pédagogiques
pip._vendor.distlib._backport.shutil Namespace Reference

Data Structures

class  Error
 
class  ExecError
 
class  ReadError
 
class  RegistryError
 
class  SpecialFileError
 

Functions

def copyfileobj (fsrc, fdst, length=16 *1024)
 
def copyfile (src, dst)
 
def copymode (src, dst)
 
def copystat (src, dst)
 
def copy (src, dst)
 
def copy2 (src, dst)
 
def ignore_patterns (*patterns)
 
def copytree (src, dst, symlinks=False, ignore=None, copy_function=copy2, ignore_dangling_symlinks=False)
 
def rmtree (path, ignore_errors=False, onerror=None)
 
def move (src, dst)
 
def get_archive_formats ()
 
def register_archive_format (name, function, extra_args=None, description='')
 
def unregister_archive_format (name)
 
def make_archive (base_name, format, root_dir=None, base_dir=None, verbose=0, dry_run=0, owner=None, group=None, logger=None)
 
def get_unpack_formats ()
 
def register_unpack_format (name, extensions, function, extra_args=None, description='')
 
def unregister_unpack_format (name)
 
def unpack_archive (filename, extract_dir=None, format=None)
 

Variables

 getpwnam
 
 getgrnam
 
 WindowsError
 

Function Documentation

◆ copy()

def pip._vendor.distlib._backport.shutil.copy (   src,
  dst 
)
Copy data and mode bits ("cp src dst").

The destination may be a directory.

◆ copy2()

def pip._vendor.distlib._backport.shutil.copy2 (   src,
  dst 
)
Copy data and all stat info ("cp -p src dst").

The destination may be a directory.

◆ copyfile()

def pip._vendor.distlib._backport.shutil.copyfile (   src,
  dst 
)
Copy data from src to dst

◆ copyfileobj()

def pip._vendor.distlib._backport.shutil.copyfileobj (   fsrc,
  fdst,
  length = 16*1024 
)
copy data from file-like object fsrc to file-like object fdst

◆ copymode()

def pip._vendor.distlib._backport.shutil.copymode (   src,
  dst 
)
Copy mode bits from src to dst

◆ copystat()

def pip._vendor.distlib._backport.shutil.copystat (   src,
  dst 
)
Copy all stat info (mode bits, atime, mtime, flags) from src to dst

◆ copytree()

def pip._vendor.distlib._backport.shutil.copytree (   src,
  dst,
  symlinks = False,
  ignore = None,
  copy_function = copy2,
  ignore_dangling_symlinks = False 
)
Recursively copy a directory tree.

The destination directory must not already exist.
If exception(s) occur, an Error is raised with a list of reasons.

If the optional symlinks flag is true, symbolic links in the
source tree result in symbolic links in the destination tree; if
it is false, the contents of the files pointed to by symbolic
links are copied. If the file pointed by the symlink doesn't
exist, an exception will be added in the list of errors raised in
an Error exception at the end of the copy process.

You can set the optional ignore_dangling_symlinks flag to true if you
want to silence this exception. Notice that this has no effect on
platforms that don't support os.symlink.

The optional ignore argument is a callable. If given, it
is called with the `src` parameter, which is the directory
being visited by copytree(), and `names` which is the list of
`src` contents, as returned by os.listdir():

    callable(src, names) -> ignored_names

Since copytree() is called recursively, the callable will be
called once for each directory that is copied. It returns a
list of names relative to the `src` directory that should
not be copied.

The optional copy_function argument is a callable that will be used
to copy each file. It will be called with the source path and the
destination path as arguments. By default, copy2() is used, but any
function that supports the same signature (like copy()) can be used.

◆ get_archive_formats()

def pip._vendor.distlib._backport.shutil.get_archive_formats ( )
Returns a list of supported formats for archiving and unarchiving.

Each element of the returned sequence is a tuple (name, description)

◆ get_unpack_formats()

def pip._vendor.distlib._backport.shutil.get_unpack_formats ( )
Returns a list of supported formats for unpacking.

Each element of the returned sequence is a tuple
(name, extensions, description)

◆ ignore_patterns()

def pip._vendor.distlib._backport.shutil.ignore_patterns ( patterns)
Function that can be used as copytree() ignore parameter.

Patterns is a sequence of glob-style patterns
that are used to exclude files

◆ make_archive()

def pip._vendor.distlib._backport.shutil.make_archive (   base_name,
  format,
  root_dir = None,
  base_dir = None,
  verbose = 0,
  dry_run = 0,
  owner = None,
  group = None,
  logger = None 
)
Create an archive file (eg. zip or tar).

'base_name' is the name of the file to create, minus any format-specific
extension; 'format' is the archive format: one of "zip", "tar", "bztar"
or "gztar".

'root_dir' is a directory that will be the root directory of the
archive; ie. we typically chdir into 'root_dir' before creating the
archive.  'base_dir' is the directory where we start archiving from;
ie. 'base_dir' will be the common prefix of all files and
directories in the archive.  'root_dir' and 'base_dir' both default
to the current directory.  Returns the name of the archive file.

'owner' and 'group' are used when creating a tar archive. By default,
uses the current owner and group.

◆ move()

def pip._vendor.distlib._backport.shutil.move (   src,
  dst 
)
Recursively move a file or directory to another location. This is
similar to the Unix "mv" command.

If the destination is a directory or a symlink to a directory, the source
is moved inside the directory. The destination path must not already
exist.

If the destination already exists but is not a directory, it may be
overwritten depending on os.rename() semantics.

If the destination is on our current filesystem, then rename() is used.
Otherwise, src is copied to the destination and then removed.
A lot more could be done here...  A look at a mv.c shows a lot of
the issues this implementation glosses over.

◆ register_archive_format()

def pip._vendor.distlib._backport.shutil.register_archive_format (   name,
  function,
  extra_args = None,
  description = '' 
)
Registers an archive format.

name is the name of the format. function is the callable that will be
used to create archives. If provided, extra_args is a sequence of
(name, value) tuples that will be passed as arguments to the callable.
description can be provided to describe the format, and will be returned
by the get_archive_formats() function.

◆ register_unpack_format()

def pip._vendor.distlib._backport.shutil.register_unpack_format (   name,
  extensions,
  function,
  extra_args = None,
  description = '' 
)
Registers an unpack format.

`name` is the name of the format. `extensions` is a list of extensions
corresponding to the format.

`function` is the callable that will be
used to unpack archives. The callable will receive archives to unpack.
If it's unable to handle an archive, it needs to raise a ReadError
exception.

If provided, `extra_args` is a sequence of
(name, value) tuples that will be passed as arguments to the callable.
description can be provided to describe the format, and will be returned
by the get_unpack_formats() function.

◆ rmtree()

def pip._vendor.distlib._backport.shutil.rmtree (   path,
  ignore_errors = False,
  onerror = None 
)
Recursively delete a directory tree.

If ignore_errors is set, errors are ignored; otherwise, if onerror
is set, it is called to handle the error with arguments (func,
path, exc_info) where func is os.listdir, os.remove, or os.rmdir;
path is the argument to that function that caused it to fail; and
exc_info is a tuple returned by sys.exc_info().  If ignore_errors
is false and onerror is None, an exception is raised.

◆ unpack_archive()

def pip._vendor.distlib._backport.shutil.unpack_archive (   filename,
  extract_dir = None,
  format = None 
)
Unpack an archive.

`filename` is the name of the archive.

`extract_dir` is the name of the target directory, where the archive
is unpacked. If not provided, the current working directory is used.

`format` is the archive format: one of "zip", "tar", or "gztar". Or any
other registered format. If not provided, unpack_archive will use the
filename extension and see if an unpacker was registered for that
extension.

In case none is found, a ValueError is raised.

◆ unregister_archive_format()

def pip._vendor.distlib._backport.shutil.unregister_archive_format (   name)

◆ unregister_unpack_format()

def pip._vendor.distlib._backport.shutil.unregister_unpack_format (   name)
Removes the pack format from the registry.

Variable Documentation

◆ getgrnam

getgrnam

◆ getpwnam

getpwnam

◆ WindowsError

WindowsError