summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/bdist.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/distutils/command/bdist.py')
-rw-r--r--Lib/distutils/command/bdist.py38
1 files changed, 20 insertions, 18 deletions
diff --git a/Lib/distutils/command/bdist.py b/Lib/distutils/command/bdist.py
index 1646993..47d4cbc 100644
--- a/Lib/distutils/command/bdist.py
+++ b/Lib/distutils/command/bdist.py
@@ -14,6 +14,18 @@ from distutils.errors import *
from distutils.util import get_platform
+def show_formats ():
+ """Print list of available formats (arguments to "--format" option).
+ """
+ from distutils.fancy_getopt import FancyGetopt
+ formats=[]
+ for format in bdist.format_commands:
+ formats.append(("formats=" + format, None,
+ bdist.format_command[format][1]))
+ pretty_printer = FancyGetopt(formats)
+ pretty_printer.print_help("List of available distribution formats:")
+
+
class bdist (Command):
description = "create a built (binary) distribution"
@@ -24,6 +36,11 @@ class bdist (Command):
"formats for distribution (comma-separated list)"),
]
+ help_options = [
+ ('help-formats', None,
+ "lists available distribution formats", show_formats),
+ ]
+
# The following commands do not take a format option from bdist
no_format_option = ('bdist_rpm',)
@@ -38,24 +55,9 @@ class bdist (Command):
'ztar': ('bdist_dumb', "compressed tar file"),
'tar': ('bdist_dumb', "tar file"),
'zip': ('bdist_dumb', "ZIP file"),
- }
-
- def show_formats ():
- """Print list of available formats (arguments to "--format" option).
- """
- from distutils.fancy_getopt import FancyGetopt
- formats=[]
- for format in bdist.format_command.keys():
- 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 = [
- ('help-formats', None,
- "lists available distribution formats",show_formats),
- ]
+ }
+ # establish the preferred order
+ format_commands = ['rpm', 'gztar', 'bztar', 'ztar', 'tar', 'zip']
def initialize_options (self):