diff options
author | Greg Ward <gward@python.net> | 2000-06-24 01:23:37 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2000-06-24 01:23:37 (GMT) |
commit | 3459381e2a271981e09441752962b748869adf5d (patch) | |
tree | fb12badb277c876627bbfbe2a2a1628941bb6234 /Lib/distutils/command/build_ext.py | |
parent | 55fced3df9efac28e4ead6e3115a4e8658e28bf5 (diff) | |
download | cpython-3459381e2a271981e09441752962b748869adf5d.zip cpython-3459381e2a271981e09441752962b748869adf5d.tar.gz cpython-3459381e2a271981e09441752962b748869adf5d.tar.bz2 |
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.
Diffstat (limited to 'Lib/distutils/command/build_ext.py')
-rw-r--r-- | Lib/distutils/command/build_ext.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index f3ff157..6b7ec74 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -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 |