diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2002-06-04 20:14:43 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2002-06-04 20:14:43 (GMT) |
commit | cd8a1148e19116db109f27d26c02e1de536dc76e (patch) | |
tree | e3969bc16f8ef0c540f1d0e72fb0da711344d758 /Lib/distutils/command/clean.py | |
parent | 6fa82a34775576b90c8ec38e8968dfbb0b02e11d (diff) | |
download | cpython-cd8a1148e19116db109f27d26c02e1de536dc76e.zip cpython-cd8a1148e19116db109f27d26c02e1de536dc76e.tar.gz cpython-cd8a1148e19116db109f27d26c02e1de536dc76e.tar.bz2 |
Make setup.py less chatty by default.
This is a conservative version of SF patch 504889. It uses the log
module instead of calling print in various places, and it ignores the
verbose argument passed to many functions and set as an attribute on
some objects. Instead, it uses the verbosity set on the logger via
the command line.
The log module is now preferred over announce() and warn() methods
that exist only for backwards compatibility.
XXX This checkin changes a lot of modules that have no test suite and
aren't exercised by the Python build process. It will need
substantial testing.
Diffstat (limited to 'Lib/distutils/command/clean.py')
-rw-r--r-- | Lib/distutils/command/clean.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Lib/distutils/command/clean.py b/Lib/distutils/command/clean.py index b4a9be4..8fddeb4 100644 --- a/Lib/distutils/command/clean.py +++ b/Lib/distutils/command/clean.py @@ -9,6 +9,7 @@ __revision__ = "$Id$" import os from distutils.core import Command from distutils.dir_util import remove_tree +from distutils import log class clean (Command): @@ -51,10 +52,10 @@ class clean (Command): # remove the build/temp.<plat> directory (unless it's already # gone) if os.path.exists(self.build_temp): - remove_tree(self.build_temp, self.verbose, self.dry_run) + remove_tree(self.build_temp, dry_run=self.dry_run) else: - self.warn("'%s' does not exist -- can't clean it" % - self.build_temp) + log.warn("'%s' does not exist -- can't clean it", + self.build_temp) if self.all: # remove build directories @@ -62,17 +63,17 @@ class clean (Command): self.bdist_base, self.build_scripts): if os.path.exists(directory): - remove_tree(directory, self.verbose, self.dry_run) + remove_tree(directory, dry_run=self.dry_run) else: - self.warn("'%s' does not exist -- can't clean it" % - directory) + log.warn("'%s' does not exist -- can't clean it", + directory) # just for the heck of it, try to remove the base build directory: # we might have emptied it right now, but if not we don't care if not self.dry_run: try: os.rmdir(self.build_base) - self.announce("removing '%s'" % self.build_base) + log.info("removing '%s'", self.build_base) except OSError: pass |