Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
distutils.command.install_data.install_data Class Reference
Inheritance diagram for distutils.command.install_data.install_data:
Inheritance graph
[legend]
Collaboration diagram for distutils.command.install_data.install_data:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def initialize_options
def finalize_options
def run
def get_inputs
def get_outputs

Public Attributes

 install_dir
 outfiles
 root
 force
 data_files
 warn_dir

Static Public Attributes

string description = "install data files"
list user_options
list boolean_options = ['force']

Detailed Description

Definition at line 12 of file install_data.py.


Member Function Documentation

Definition at line 35 of file install_data.py.

00035 
00036     def finalize_options(self):
00037         self.set_undefined_options('install',
00038                                    ('install_data', 'install_dir'),
00039                                    ('root', 'root'),
00040                                    ('force', 'force'),
00041                                   )

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 75 of file install_data.py.

00075 
00076     def get_inputs(self):
00077         return self.data_files or []

Definition at line 78 of file install_data.py.

00078 
00079     def get_outputs(self):
00080         return self.outfiles

Definition at line 27 of file install_data.py.

00027 
00028     def initialize_options(self):
00029         self.install_dir = None
00030         self.outfiles = []
00031         self.root = None
00032         self.force = 0
00033         self.data_files = self.distribution.data_files
00034         self.warn_dir = 1

Definition at line 42 of file install_data.py.

00042 
00043     def run(self):
00044         self.mkpath(self.install_dir)
00045         for f in self.data_files:
00046             if isinstance(f, str):
00047                 # it's a simple file, so copy it
00048                 f = convert_path(f)
00049                 if self.warn_dir:
00050                     self.warn("setup script did not provide a directory for "
00051                               "'%s' -- installing right in '%s'" %
00052                               (f, self.install_dir))
00053                 (out, _) = self.copy_file(f, self.install_dir)
00054                 self.outfiles.append(out)
00055             else:
00056                 # it's a tuple with path to install to and a list of files
00057                 dir = convert_path(f[0])
00058                 if not os.path.isabs(dir):
00059                     dir = os.path.join(self.install_dir, dir)
00060                 elif self.root:
00061                     dir = change_root(self.root, dir)
00062                 self.mkpath(dir)
00063 
00064                 if f[1] == []:
00065                     # If there are no files listed, the user must be
00066                     # trying to create an empty directory, so add the
00067                     # directory to the list of output files.
00068                     self.outfiles.append(dir)
00069                 else:
00070                     # Copy files, adding them to the list of output files.
00071                     for data in f[1]:
00072                         data = convert_path(data)
00073                         (out, _) = self.copy_file(data, dir)
00074                         self.outfiles.append(out)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 25 of file install_data.py.

Definition at line 32 of file install_data.py.

Definition at line 14 of file install_data.py.

Definition at line 31 of file install_data.py.

Definition at line 28 of file install_data.py.

Definition at line 29 of file install_data.py.

Definition at line 30 of file install_data.py.

Initial value:
[
        ('install-dir=', 'd',
         "base directory for installing data files "
         "(default: installation base dir)"),
        ('root=', None,
         "install everything relative to this alternate root directory"),
        ('force', 'f', "force installation (overwrite existing files)"),
        ]

Definition at line 16 of file install_data.py.

Definition at line 33 of file install_data.py.


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