diff options
author | Greg Ward <gward@python.net> | 2000-06-24 00:23:20 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2000-06-24 00:23:20 (GMT) |
commit | 2ff7887270385bd6dddc2d5461486334b4fec8bc (patch) | |
tree | 35c3f4814ec717a72c03a70d24bad2cccf1ac3aa /Lib/distutils/command | |
parent | ffcaf2dd72ef0735d0eea125f1789d48c575f9b5 (diff) | |
download | cpython-2ff7887270385bd6dddc2d5461486334b4fec8bc.zip cpython-2ff7887270385bd6dddc2d5461486334b4fec8bc.tar.gz cpython-2ff7887270385bd6dddc2d5461486334b4fec8bc.tar.bz2 |
Stylistic/formatting changes to Rene Liebscher's '--help-xxx' patch.
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r-- | Lib/distutils/command/bdist.py | 29 | ||||
-rw-r--r-- | Lib/distutils/command/build.py | 3 | ||||
-rw-r--r-- | Lib/distutils/command/build_clib.py | 3 | ||||
-rw-r--r-- | Lib/distutils/command/sdist.py | 4 |
4 files changed, 21 insertions, 18 deletions
diff --git a/Lib/distutils/command/bdist.py b/Lib/distutils/command/bdist.py index 66ef113..1646993 100644 --- a/Lib/distutils/command/bdist.py +++ b/Lib/distutils/command/bdist.py @@ -21,7 +21,7 @@ class bdist (Command): user_options = [('bdist-base=', 'b', "temporary directory for creating built distributions"), ('formats=', None, - "formats for distribution"), + "formats for distribution (comma-separated list)"), ] # The following commands do not take a format option from bdist @@ -32,22 +32,24 @@ class bdist (Command): default_format = { 'posix': 'gztar', 'nt': 'zip', } - format_command = { 'gztar': ('bdist_dumb',"gzipped tar-file"), - 'bztar': ('bdist_dumb',"bzip2-ed tar-file"), - 'ztar': ('bdist_dumb',"compressed tar-file"), - 'tar': ('bdist_dumb',"tar-file"), - 'rpm': ('bdist_rpm',"rpm distribution"), - 'zip': ('bdist_dumb',"zip-file"), + format_command = { 'rpm': ('bdist_rpm', "RPM distribution"), + 'gztar': ('bdist_dumb', "gzip'ed tar file"), + 'bztar': ('bdist_dumb', "bzip2'ed tar file"), + 'ztar': ('bdist_dumb', "compressed tar file"), + 'tar': ('bdist_dumb', "tar file"), + 'zip': ('bdist_dumb', "ZIP file"), } - # prints all possible arguments to --format - def show_formats(): + def show_formats (): + """Print list of available formats (arguments to "--format" option). + """ from distutils.fancy_getopt import FancyGetopt - list_of_formats=[] + formats=[] for format in bdist.format_command.keys(): - list_of_formats.append(("formats="+format,None,bdist.format_command[format][1])) - list_of_formats.sort() - pretty_printer=FancyGetopt(list_of_formats) + formats.append(("formats="+format, None, + bdist.format_command[format][1])) + formats.sort() + pretty_printer = FancyGetopt(formats) pretty_printer.print_help("List of available distribution formats:") help_options = [ @@ -87,7 +89,6 @@ class bdist (Command): def run (self): for format in self.formats: - try: cmd_name = self.format_command[format][0] except KeyError: diff --git a/Lib/distutils/command/build.py b/Lib/distutils/command/build.py index c064f83..d5513fc 100644 --- a/Lib/distutils/command/build.py +++ b/Lib/distutils/command/build.py @@ -36,9 +36,10 @@ class build (Command): ('force', 'f', "forcibly build everything (ignore file timestamps)"), ] + help_options = [ ('help-compiler', None, - "lists available compilers",show_compilers), + "list available compilers", show_compilers), ] def initialize_options (self): diff --git a/Lib/distutils/command/build_clib.py b/Lib/distutils/command/build_clib.py index 72df372..9a82ac0 100644 --- a/Lib/distutils/command/build_clib.py +++ b/Lib/distutils/command/build_clib.py @@ -42,9 +42,10 @@ class build_clib (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): diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py index ded8ec2..93e53bb 100644 --- a/Lib/distutils/command/sdist.py +++ b/Lib/distutils/command/sdist.py @@ -36,7 +36,7 @@ class sdist (Command): ('force-manifest', 'f', "forcibly regenerate the manifest and carry on as usual"), ('formats=', None, - "formats for source distribution"), + "formats for source distribution (comma-separated list)"), ('keep-tree', 'k', "keep the distribution tree around after creating " + "archive file(s)"), @@ -61,7 +61,7 @@ class sdist (Command): help_options = [ ('help-formats', None, - "lists available distribution formats", show_formats), + "list available distribution formats", show_formats), ] negative_opts = {'use-defaults': 'no-defaults'} |