General cleanup, raise normalization in Lib/distutils.

This commit is contained in:
Collin Winter 2007-08-30 03:52:21 +00:00
parent a73bfee73d
commit 5b7e9d76f3
47 changed files with 963 additions and 1640 deletions

View file

@ -2,8 +2,6 @@
Implements the Distutils 'build' command."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id$"
import sys, os
@ -11,12 +9,12 @@ from distutils.core import Command
from distutils.util import get_platform
def show_compilers ():
def show_compilers():
from distutils.ccompiler import show_compilers
show_compilers()
class build (Command):
class build(Command):
description = "build everything needed to install"
@ -51,7 +49,7 @@ class build (Command):
"list available compilers", show_compilers),
]
def initialize_options (self):
def initialize_options(self):
self.build_base = 'build'
# these are decided only after 'build_base' has its final value
# (unless overridden by the user or client)
@ -65,8 +63,7 @@ class build (Command):
self.force = 0
self.executable = None
def finalize_options (self):
def finalize_options(self):
plat_specifier = ".%s-%s" % (get_platform(), sys.version[0:3])
# 'build_purelib' and 'build_platlib' just default to 'lib' and
@ -98,11 +95,8 @@ class build (Command):
if self.executable is None:
self.executable = os.path.normpath(sys.executable)
# finalize_options ()
def run (self):
def run(self):
# Run all relevant sub-commands. This will be some subset of:
# - build_py - pure Python modules
# - build_clib - standalone C libraries
@ -114,16 +108,16 @@ class build (Command):
# -- Predicates for the sub-command list ---------------------------
def has_pure_modules (self):
def has_pure_modules(self):
return self.distribution.has_pure_modules()
def has_c_libraries (self):
def has_c_libraries(self):
return self.distribution.has_c_libraries()
def has_ext_modules (self):
def has_ext_modules(self):
return self.distribution.has_ext_modules()
def has_scripts (self):
def has_scripts(self):
return self.distribution.has_scripts()
@ -132,5 +126,3 @@ class build (Command):
('build_ext', has_ext_modules),
('build_scripts', has_scripts),
]
# class build