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/ccompiler.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/ccompiler.py')
-rw-r--r-- | Lib/distutils/ccompiler.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py index f8d13c0..4c8b881 100644 --- a/Lib/distutils/ccompiler.py +++ b/Lib/distutils/ccompiler.py @@ -16,7 +16,7 @@ from distutils.file_util import move_file from distutils.dir_util import mkpath from distutils.dep_util import newer_pairwise, newer_group from distutils.util import split_quoted, execute - +from distutils import log class CCompiler: """Abstract base class to define the interface that must be implemented @@ -80,7 +80,6 @@ class CCompiler: dry_run=0, force=0): - self.verbose = verbose self.dry_run = dry_run self.force = force @@ -808,8 +807,7 @@ class CCompiler: # -- Utility methods ----------------------------------------------- def announce (self, msg, level=1): - if self.verbose >= level: - print msg + log.debug(msg) def debug_print (self, msg): from distutils.core import DEBUG @@ -820,16 +818,16 @@ class CCompiler: sys.stderr.write ("warning: %s\n" % msg) def execute (self, func, args, msg=None, level=1): - execute(func, args, msg, self.verbose >= level, self.dry_run) + execute(func, args, msg, self.dry_run) def spawn (self, cmd): - spawn (cmd, verbose=self.verbose, dry_run=self.dry_run) + spawn (cmd, dry_run=self.dry_run) def move_file (self, src, dst): - return move_file (src, dst, verbose=self.verbose, dry_run=self.dry_run) + return move_file (src, dst, dry_run=self.dry_run) def mkpath (self, name, mode=0777): - mkpath (name, mode, self.verbose, self.dry_run) + mkpath (name, mode, self.dry_run) # class CCompiler @@ -957,7 +955,10 @@ def new_compiler (plat=None, ("can't compile C/C++ code: unable to find class '%s' " + "in module '%s'") % (class_name, module_name) - return klass (verbose, dry_run, force) + # XXX The None is necessary to preserve backwards compatibility + # with classes that expect verbose to be the first positional + # argument. + return klass (None, dry_run, force) def gen_preprocess_options (macros, include_dirs): |