summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/mwerkscompiler.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2002-06-04 20:14:43 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2002-06-04 20:14:43 (GMT)
commitcd8a1148e19116db109f27d26c02e1de536dc76e (patch)
treee3969bc16f8ef0c540f1d0e72fb0da711344d758 /Lib/distutils/mwerkscompiler.py
parent6fa82a34775576b90c8ec38e8968dfbb0b02e11d (diff)
downloadcpython-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/mwerkscompiler.py')
-rw-r--r--Lib/distutils/mwerkscompiler.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/Lib/distutils/mwerkscompiler.py b/Lib/distutils/mwerkscompiler.py
index 7c77b8b..6242f12 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):