Back to index

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

List of all members.

Public Member Functions

def initialize_options
def finalize_options
def run

Public Attributes

 build_base
 build_lib
 build_temp
 build_scripts
 bdist_base
 all

Static Public Attributes

string description = "clean up temporary files from 'build' command"
list user_options
list boolean_options = ['all']

Detailed Description

Definition at line 12 of file clean.py.


Member Function Documentation

Definition at line 40 of file clean.py.

00040 
00041     def finalize_options(self):
00042         self.set_undefined_options('build',
00043                                    ('build_base', 'build_base'),
00044                                    ('build_lib', 'build_lib'),
00045                                    ('build_scripts', 'build_scripts'),
00046                                    ('build_temp', 'build_temp'))
00047         self.set_undefined_options('bdist',
00048                                    ('bdist_base', 'bdist_base'))

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 32 of file clean.py.

00032 
00033     def initialize_options(self):
00034         self.build_base = None
00035         self.build_lib = None
00036         self.build_temp = None
00037         self.build_scripts = None
00038         self.bdist_base = None
00039         self.all = None

Definition at line 49 of file clean.py.

00049 
00050     def run(self):
00051         # remove the build/temp.<plat> directory (unless it's already
00052         # gone)
00053         if os.path.exists(self.build_temp):
00054             remove_tree(self.build_temp, dry_run=self.dry_run)
00055         else:
00056             log.debug("'%s' does not exist -- can't clean it",
00057                       self.build_temp)
00058 
00059         if self.all:
00060             # remove build directories
00061             for directory in (self.build_lib,
00062                               self.bdist_base,
00063                               self.build_scripts):
00064                 if os.path.exists(directory):
00065                     remove_tree(directory, dry_run=self.dry_run)
00066                 else:
00067                     log.warn("'%s' does not exist -- can't clean it",
00068                              directory)
00069 
00070         # just for the heck of it, try to remove the base build directory:
00071         # we might have emptied it right now, but if not we don't care
00072         if not self.dry_run:
00073             try:
00074                 os.rmdir(self.build_base)
00075                 log.info("removing '%s'", self.build_base)
00076             except OSError:
00077                 pass

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 38 of file clean.py.

Definition at line 37 of file clean.py.

Definition at line 30 of file clean.py.

Definition at line 33 of file clean.py.

Definition at line 34 of file clean.py.

Definition at line 36 of file clean.py.

Definition at line 35 of file clean.py.

string distutils.command.clean.clean.description = "clean up temporary files from 'build' command" [static]

Definition at line 14 of file clean.py.

Initial value:
[
        ('build-base=', 'b',
         "base build directory (default: 'build.build-base')"),
        ('build-lib=', None,
         "build directory for all modules (default: 'build.build-lib')"),
        ('build-temp=', 't',
         "temporary build directory (default: 'build.build-temp')"),
        ('build-scripts=', None,
         "build directory for scripts (default: 'build.build-scripts')"),
        ('bdist-base=', None,
         "temporary directory for built distributions"),
        ('all', 'a',
         "remove all build output, not just temporary by-products")
    ]

Definition at line 15 of file clean.py.


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