From cd8a1148e19116db109f27d26c02e1de536dc76e Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Tue, 4 Jun 2002 20:14:43 +0000 Subject: 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. --- Lib/distutils/spawn.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'Lib/distutils/spawn.py') diff --git a/Lib/distutils/spawn.py b/Lib/distutils/spawn.py index 5b6016e0d8..4df6e097de 100644 --- a/Lib/distutils/spawn.py +++ b/Lib/distutils/spawn.py @@ -12,7 +12,7 @@ __revision__ = "$Id$" import sys, os, string from distutils.errors import * - +from distutils import log def spawn (cmd, search_path=1, @@ -27,19 +27,18 @@ def spawn (cmd, If 'search_path' is true (the default), the system's executable search path will be used to find the program; otherwise, cmd[0] must be the - exact path to the executable. If 'verbose' is true, a one-line summary - of the command will be printed before it is run. If 'dry_run' is true, + exact path to the executable.If 'dry_run' is true, the command will not actually be run. Raise DistutilsExecError if running the program fails in any way; just return on success. """ if os.name == 'posix': - _spawn_posix(cmd, search_path, verbose, dry_run) + _spawn_posix(cmd, search_path, dry_run=dry_run) elif os.name == 'nt': - _spawn_nt(cmd, search_path, verbose, dry_run) + _spawn_nt(cmd, search_path, dry_run=dry_run) elif os.name == 'os2': - _spawn_os2(cmd, search_path, verbose, dry_run) + _spawn_os2(cmd, search_path, dry_run=dry_run) else: raise DistutilsPlatformError, \ "don't know how to spawn programs on platform '%s'" % os.name @@ -74,8 +73,7 @@ def _spawn_nt (cmd, if search_path: # either we find one or it stays the same executable = find_executable(executable) or executable - if verbose: - print string.join([executable] + cmd[1:], ' ') + log.info(string.join([executable] + cmd[1:], ' ')) if not dry_run: # spawn for NT requires a full path to the .exe try: @@ -100,8 +98,7 @@ def _spawn_os2 (cmd, if search_path: # either we find one or it stays the same executable = find_executable(executable) or executable - if verbose: - print string.join([executable] + cmd[1:], ' ') + log.info(string.join([executable] + cmd[1:], ' ')) if not dry_run: # spawnv for OS/2 EMX requires a full path to the .exe try: @@ -122,8 +119,7 @@ def _spawn_posix (cmd, verbose=0, dry_run=0): - if verbose: - print string.join(cmd, ' ') + log.info(string.join(cmd, ' ')) if dry_run: return exec_fn = search_path and os.execvp or os.execv -- cgit v1.2.1