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/mwerkscompiler.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'Lib/distutils/mwerkscompiler.py') diff --git a/Lib/distutils/mwerkscompiler.py b/Lib/distutils/mwerkscompiler.py index 7c77b8bcef..6242f12aa1 100644 --- a/Lib/distutils/mwerkscompiler.py +++ b/Lib/distutils/mwerkscompiler.py @@ -13,6 +13,7 @@ from distutils.ccompiler import \ CCompiler, gen_preprocess_options, gen_lib_options import distutils.util import distutils.dir_util +from distutils import log import mkcwproject class MWerksCompiler (CCompiler) : @@ -132,8 +133,8 @@ class MWerksCompiler (CCompiler) : exportname = basename + '.mcp.exp' prefixname = 'mwerks_%s_config.h'%basename # Create the directories we need - distutils.dir_util.mkpath(build_temp, self.verbose, self.dry_run) - distutils.dir_util.mkpath(output_dir, self.verbose, self.dry_run) + distutils.dir_util.mkpath(build_temp, dry_run=self.dry_run) + distutils.dir_util.mkpath(output_dir, dry_run=self.dry_run) # And on to filling in the parameters for the project builder settings = {} settings['mac_exportname'] = exportname @@ -159,8 +160,7 @@ class MWerksCompiler (CCompiler) : return # Build the export file exportfilename = os.path.join(build_temp, exportname) - if self.verbose: - print '\tCreate export file', exportfilename + log.debug("\tCreate export file", exportfilename) fp = open(exportfilename, 'w') fp.write('%s\n'%export_symbols[0]) fp.close() @@ -181,8 +181,7 @@ class MWerksCompiler (CCompiler) : # because we pass this pathname to CodeWarrior in an AppleEvent, and CW # doesn't have a clue about our working directory. xmlfilename = os.path.join(os.getcwd(), os.path.join(build_temp, xmlname)) - if self.verbose: - print '\tCreate XML file', xmlfilename + log.debug("\tCreate XML file", xmlfilename) xmlbuilder = mkcwproject.cwxmlgen.ProjectBuilder(settings) xmlbuilder.generate() xmldata = settings['tmp_projectxmldata'] @@ -191,12 +190,10 @@ class MWerksCompiler (CCompiler) : fp.close() # Generate the project. Again a full pathname. projectfilename = os.path.join(os.getcwd(), os.path.join(build_temp, projectname)) - if self.verbose: - print '\tCreate project file', projectfilename + log.debug('\tCreate project file', projectfilename) mkcwproject.makeproject(xmlfilename, projectfilename) # And build it - if self.verbose: - print '\tBuild project' + log.debug('\tBuild project') mkcwproject.buildproject(projectfilename) def _filename_to_abs(self, filename): -- cgit v1.2.1