<commit_before>"""distutils.command.bdist

Implements the Distutils 'bdist' command (create a built [binary]
distribution)."""

# created 2000/03/29, <NAME>

__revision__ = "$Id$"

import os, string
from types import *
from distutils.core import Command
from distutils.errors import *


class bdist (Command):

    description = "create a built (binary) distribution"

    user_options = [('format=', 'f',
                     "format for distribution (tar, ztar, gztar, zip, ... )"),
                   ]

    # This won't do in reality: will need to distinguish RPM-ish Linux,
    # Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
    default_format = { 'posix': 'gztar',
                       'nt': 'zip', }

    format_command = { 'gztar': 'bdist_dumb',
                       'ztar':  'bdist_dumb',
                       'tar':   'bdist_dumb',
                       'zip':   'bdist_dumb', }


    def initialize_options (self):
        self.format = None

    # initialize_options()


    def finalize_options (self):
        if self.format is None:
            try:
                self.format = self.default_format[os.name]
            except KeyError:
                raise DistutilsPlatformError, \
                      "don't know how to create built distributions " + \
                      "on platform %s" % os.name
        #elif type (self.format) is StringType:
        #    self.format = string.split (self.format, ',')
            

    # finalize_options()


    def run (self):

        try:
            cmd_name = self.format_command[self.format]
        except KeyError:
            raise DistutilsOptionError, \
                  "invalid archive format '%s'" % self.format

        sub_cmd = self.find_peer (cmd_name)
        sub_cmd.set_option ('format', self.format)

    # run()

# class bdist
<commit_msg>Oops, got a little too enthusiastic deleting code in that last revision: we still have to *run* the sub-command that creates a built distribution.<commit_after>"""distutils.command.bdist

Implements the Distutils 'bdist' command (create a built [binary]
distribution)."""

# created 2000/03/29, <NAME>

__revision__ = "$Id$"

import os, string
from types import *
from distutils.core import Command
from distutils.errors import *


class bdist (Command):

    description = "create a built (binary) distribution"

    user_options = [('format=', 'f',
                     "format for distribution (tar, ztar, gztar, zip, ... )"),
                   ]

    # This won't do in reality: will need to distinguish RPM-ish Linux,
    # Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
    default_format = { 'posix': 'gztar',
                       'nt': 'zip', }

    format_command = { 'gztar': 'bdist_dumb',
                       'ztar':  'bdist_dumb',
                       'tar':   'bdist_dumb',
                       'zip':   'bdist_dumb', }


    def initialize_options (self):
        self.format = None

    # initialize_options()


    def finalize_options (self):
        if self.format is None:
            try:
                self.format = self.default_format[os.name]
            except KeyError:
                raise DistutilsPlatformError, \
                      "don't know how to create built distributions " + \
                      "on platform %s" % os.name
        #elif type (self.format) is StringType:
        #    self.format = string.split (self.format, ',')
            

    # finalize_options()


    def run (self):

        try:
            cmd_name = self.format_command[self.format]
        except KeyError:
            raise DistutilsOptionError, \
                  "invalid archive format '%s'" % self.format

        sub_cmd = self.find_peer (cmd_name)
        sub_cmd.set_option ('format', self.format)
        self.run_peer (cmd_name)

    # run()

# class bdist

{'fraction_non_alphanumeric': 0.11113989637305699, 'fraction_numerical': 0.004145077720207254, 'mean_word_length': 1.9139622641509435, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3988001', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1078, 'n_words': 313}