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/build_py.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/build_py.py')
-rw-r--r-- | Lib/distutils/command/build_py.py | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/Lib/distutils/command/build_py.py b/Lib/distutils/command/build_py.py index 97d094b..388d3cb 100644 --- a/Lib/distutils/command/build_py.py +++ b/Lib/distutils/command/build_py.py @@ -13,7 +13,7 @@ from glob import glob from distutils.core import Command from distutils.errors import * from distutils.util import convert_path - +from distutils import log class build_py (Command): @@ -176,8 +176,8 @@ class build_py (Command): if os.path.isfile(init_py): return init_py else: - self.warn(("package init file '%s' not found " + - "(or not a regular file)") % init_py) + log.warn(("package init file '%s' not found " + + "(or not a regular file)"), init_py) # Either not in a package at all (__init__.py not expected), or # __init__.py doesn't exist -- so don't return the filename. @@ -188,8 +188,7 @@ class build_py (Command): def check_module (self, module, module_file): if not os.path.isfile(module_file): - self.warn("file %s (for module %s) not found" % - (module_file, module)) + log.warn("file %s (for module %s) not found", module_file, module) return 0 else: return 1 @@ -389,13 +388,9 @@ class build_py (Command): if self.compile: byte_compile(files, optimize=0, - force=self.force, - prefix=prefix, - verbose=self.verbose, dry_run=self.dry_run) + force=self.force, prefix=prefix, dry_run=self.dry_run) if self.optimize > 0: byte_compile(files, optimize=self.optimize, - force=self.force, - prefix=prefix, - verbose=self.verbose, dry_run=self.dry_run) + force=self.force, prefix=prefix, dry_run=self.dry_run) # class build_py |