Changed so all the help-generating functions are defined, at module-level,

in the module of the command classes that have command-specific
help options.  This lets us keep the principle of lazily importing
the ccompiler module, and also gets away from defining non-methods
at class level.
This commit is contained in:
Greg Ward 2000-06-24 01:23:37 +00:00
parent 55fced3df9
commit 3459381e2a
5 changed files with 56 additions and 41 deletions

View file

@ -14,7 +14,6 @@ from distutils.core import Command
from distutils.errors import *
from distutils.dep_util import newer_group
from distutils.extension import Extension
from distutils.ccompiler import show_compilers
# An extension name is just a dot-separated list of Python NAMEs (ie.
# the same as a fully-qualified module name).
@ -22,6 +21,11 @@ extension_name_re = re.compile \
(r'^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$')
def show_compilers ():
from distutils.ccompiler import show_compilers
show_compilers()
class build_ext (Command):
description = "build C/C++ extensions (compile/link to build directory)"
@ -73,12 +77,12 @@ class build_ext (Command):
('compiler=', 'c',
"specify the compiler type"),
]
help_options = [
('help-compiler', None,
"lists available compilers",show_compilers),
"list available compilers", show_compilers),
]
def initialize_options (self):
self.extensions = None
self.build_lib = None