Current File : /home/mmdealscpanel/yummmdeals.com/command.tar
__init__.py000064400000001437150513660020006660 0ustar00"""distutils.command

Package containing implementation of all the standard Distutils
commands."""

__all__ = ['build',
           'build_py',
           'build_ext',
           'build_clib',
           'build_scripts',
           'clean',
           'install',
           'install_lib',
           'install_headers',
           'install_scripts',
           'install_data',
           'sdist',
           'register',
           'bdist',
           'bdist_dumb',
           'bdist_rpm',
           'bdist_wininst',
           'check',
           'upload',
           # These two are reserved for future use:
           #'bdist_sdux',
           #'bdist_pkgtool',
           # Note:
           # bdist_packager is not included because it only provides
           # an abstract base class
          ]
clean.py000064400000005330150513660020006177 0ustar00"""distutils.command.clean

Implements the Distutils 'clean' command."""

# contributed by Bastian Kleineidam <calvin@cs.uni-sb.de>, added 2000-03-18

import os
from distutils.core import Command
from distutils.dir_util import remove_tree
from distutils import log

class clean(Command):

    description = "clean up temporary files from 'build' command"
    user_options = [
        ('build-base=', 'b',
         "base build directory (default: 'build.build-base')"),
        ('build-lib=', None,
         "build directory for all modules (default: 'build.build-lib')"),
        ('build-temp=', 't',
         "temporary build directory (default: 'build.build-temp')"),
        ('build-scripts=', None,
         "build directory for scripts (default: 'build.build-scripts')"),
        ('bdist-base=', None,
         "temporary directory for built distributions"),
        ('all', 'a',
         "remove all build output, not just temporary by-products")
    ]

    boolean_options = ['all']

    def initialize_options(self):
        self.build_base = None
        self.build_lib = None
        self.build_temp = None
        self.build_scripts = None
        self.bdist_base = None
        self.all = None

    def finalize_options(self):
        self.set_undefined_options('build',
                                   ('build_base', 'build_base'),
                                   ('build_lib', 'build_lib'),
                                   ('build_scripts', 'build_scripts'),
                                   ('build_temp', 'build_temp'))
        self.set_undefined_options('bdist',
                                   ('bdist_base', 'bdist_base'))

    def run(self):
        # remove the build/temp.<plat> directory (unless it's already
        # gone)
        if os.path.exists(self.build_temp):
            remove_tree(self.build_temp, dry_run=self.dry_run)
        else:
            log.debug("'%s' does not exist -- can't clean it",
                      self.build_temp)

        if self.all:
            # remove build directories
            for directory in (self.build_lib,
                              self.bdist_base,
                              self.build_scripts):
                if os.path.exists(directory):
                    remove_tree(directory, dry_run=self.dry_run)
                else:
                    log.warn("'%s' does not exist -- can't clean it",
                             directory)

        # just for the heck of it, try to remove the base build directory:
        # we might have emptied it right now, but if not we don't care
        if not self.dry_run:
            try:
                os.rmdir(self.build_base)
                log.info("removing '%s'", self.build_base)
            except OSError:
                pass
bdist.py000064400000012672150513660020006231 0ustar00"""distutils.command.bdist

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

import os
from distutils.core import Command
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"

    user_options = [('bdist-base=', 'b',
                     "temporary directory for creating built distributions"),
                    ('plat-name=', 'p',
                     "platform name to embed in generated filenames "
                     "(default: %s)" % get_platform()),
                    ('formats=', None,
                     "formats for distribution (comma-separated list)"),
                    ('dist-dir=', 'd',
                     "directory to put final built distributions in "
                     "[default: dist]"),
                    ('skip-build', None,
                     "skip rebuilding everything (for testing/debugging)"),
                    ('owner=', 'u',
                     "Owner name used when creating a tar file"
                     " [default: current user]"),
                    ('group=', 'g',
                     "Group name used when creating a tar file"
                     " [default: current group]"),
                   ]

    boolean_options = ['skip-build']

    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',)

    # 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'}

    # Establish the preferred order (for the --help-formats option).
    format_commands = ['rpm', 'gztar', 'bztar', 'xztar', 'ztar', 'tar',
                       'wininst', 'zip', 'msi']

    # And the real information.
    format_command = {'rpm':   ('bdist_rpm',  "RPM distribution"),
                      'gztar': ('bdist_dumb', "gzip'ed tar file"),
                      'bztar': ('bdist_dumb', "bzip2'ed tar file"),
                      'xztar': ('bdist_dumb', "xz'ed tar file"),
                      'ztar':  ('bdist_dumb', "compressed tar file"),
                      'tar':   ('bdist_dumb', "tar file"),
                      'wininst': ('bdist_wininst',
                                  "Windows executable installer"),
                      'zip':   ('bdist_dumb', "ZIP file"),
                      'msi':   ('bdist_msi',  "Microsoft Installer")
                      }


    def initialize_options(self):
        self.bdist_base = None
        self.plat_name = None
        self.formats = None
        self.dist_dir = None
        self.skip_build = 0
        self.group = None
        self.owner = None

    def finalize_options(self):
        # have to finalize 'plat_name' before 'bdist_base'
        if self.plat_name is None:
            if self.skip_build:
                self.plat_name = get_platform()
            else:
                self.plat_name = self.get_finalized_command('build').plat_name

        # 'bdist_base' -- parent of per-built-distribution-format
        # temporary directories (eg. we'll probably have
        # "build/bdist.<plat>/dumb", "build/bdist.<plat>/rpm", etc.)
        if self.bdist_base is None:
            build_base = self.get_finalized_command('build').build_base
            self.bdist_base = os.path.join(build_base,
                                           'bdist.' + self.plat_name)

        self.ensure_string_list('formats')
        if self.formats is None:
            try:
                self.formats = [self.default_format[os.name]]
            except KeyError:
                raise DistutilsPlatformError(
                      "don't know how to create built distributions "
                      "on platform %s" % os.name)

        if self.dist_dir is None:
            self.dist_dir = "dist"

    def run(self):
        # Figure out which sub-commands we need to run.
        commands = []
        for format in self.formats:
            try:
                commands.append(self.format_command[format][0])
            except KeyError:
                raise DistutilsOptionError("invalid format '%s'" % format)

        # Reinitialize and run each command.
        for i in range(len(self.formats)):
            cmd_name = commands[i]
            sub_cmd = self.reinitialize_command(cmd_name)
            if cmd_name not in self.no_format_option:
                sub_cmd.format = self.formats[i]

            # passing the owner and group names for tar archiving
            if cmd_name == 'bdist_dumb':
                sub_cmd.owner = self.owner
                sub_cmd.group = self.group

            # If we're going to need to run this command again, tell it to
            # keep its temporary files around so subsequent runs go faster.
            if cmd_name in commands[i+1:]:
                sub_cmd.keep_temp = 1
            self.run_command(cmd_name)
install.py000064400000065201150513660020006566 0ustar00"""distutils.command.install

Implements the Distutils 'install' command."""

import sys
import os

from distutils import log
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.sysconfig import get_config_vars
from distutils.errors import DistutilsPlatformError
from distutils.file_util import write_file
from distutils.util import convert_path, subst_vars, change_root
from distutils.util import get_platform
from distutils.errors import DistutilsOptionError

from site import USER_BASE
from site import USER_SITE
HAS_USER_SITE = True

WINDOWS_SCHEME = {
    'purelib': '$base/Lib/site-packages',
    'platlib': '$base/Lib/site-packages',
    'headers': '$base/Include/$dist_name',
    'scripts': '$base/Scripts',
    'data'   : '$base',
}

INSTALL_SCHEMES = {
    'unix_prefix': {
        'purelib': '$base/lib/python$py_version_short/site-packages',
        'platlib': '$platbase/lib64/python$py_version_short/site-packages',
        'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
        'scripts': '$base/bin',
        'data'   : '$base',
        },
    'unix_home': {
        'purelib': '$base/lib/python',
        'platlib': '$base/lib64/python',
        'headers': '$base/include/python/$dist_name',
        'scripts': '$base/bin',
        'data'   : '$base',
        },
    'nt': WINDOWS_SCHEME,
    }

# user site schemes
if HAS_USER_SITE:
    INSTALL_SCHEMES['nt_user'] = {
        'purelib': '$usersite',
        'platlib': '$usersite',
        'headers': '$userbase/Python$py_version_nodot/Include/$dist_name',
        'scripts': '$userbase/Python$py_version_nodot/Scripts',
        'data'   : '$userbase',
        }

    INSTALL_SCHEMES['unix_user'] = {
        'purelib': '$usersite',
        'platlib': '$usersite',
        'headers':
            '$userbase/include/python$py_version_short$abiflags/$dist_name',
        'scripts': '$userbase/bin',
        'data'   : '$userbase',
        }

# The keys to an installation scheme; if any new types of files are to be
# installed, be sure to add an entry to every installation scheme above,
# and to SCHEME_KEYS here.
SCHEME_KEYS = ('purelib', 'platlib', 'headers', 'scripts', 'data')


class install(Command):

    description = "install everything from build directory"

    user_options = [
        # Select installation scheme and set base director(y|ies)
        ('prefix=', None,
         "installation prefix"),
        ('exec-prefix=', None,
         "(Unix only) prefix for platform-specific files"),
        ('home=', None,
         "(Unix only) home directory to install under"),

        # Or, just set the base director(y|ies)
        ('install-base=', None,
         "base installation directory (instead of --prefix or --home)"),
        ('install-platbase=', None,
         "base installation directory for platform-specific files " +
         "(instead of --exec-prefix or --home)"),
        ('root=', None,
         "install everything relative to this alternate root directory"),

        # Or, explicitly set the installation scheme
        ('install-purelib=', None,
         "installation directory for pure Python module distributions"),
        ('install-platlib=', None,
         "installation directory for non-pure module distributions"),
        ('install-lib=', None,
         "installation directory for all module distributions " +
         "(overrides --install-purelib and --install-platlib)"),

        ('install-headers=', None,
         "installation directory for C/C++ headers"),
        ('install-scripts=', None,
         "installation directory for Python scripts"),
        ('install-data=', None,
         "installation directory for data files"),

        # Byte-compilation options -- see install_lib.py for details, as
        # these are duplicated from there (but only install_lib does
        # anything with them).
        ('compile', 'c', "compile .py to .pyc [default]"),
        ('no-compile', None, "don't compile .py files"),
        ('optimize=', 'O',
         "also compile with optimization: -O1 for \"python -O\", "
         "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"),

        # Miscellaneous control options
        ('force', 'f',
         "force installation (overwrite any existing files)"),
        ('skip-build', None,
         "skip rebuilding everything (for testing/debugging)"),

        # Where to install documentation (eventually!)
        #('doc-format=', None, "format of documentation to generate"),
        #('install-man=', None, "directory for Unix man pages"),
        #('install-html=', None, "directory for HTML documentation"),
        #('install-info=', None, "directory for GNU info files"),

        ('record=', None,
         "filename in which to record list of installed files"),
        ]

    boolean_options = ['compile', 'force', 'skip-build']

    if HAS_USER_SITE:
        user_options.append(('user', None,
                             "install in user site-package '%s'" % USER_SITE))
        boolean_options.append('user')

    negative_opt = {'no-compile' : 'compile'}


    def initialize_options(self):
        """Initializes options."""
        # High-level options: these select both an installation base
        # and scheme.
        self.prefix = None
        self.exec_prefix = None
        self.home = None
        self.user = 0

        # These select only the installation base; it's up to the user to
        # specify the installation scheme (currently, that means supplying
        # the --install-{platlib,purelib,scripts,data} options).
        self.install_base = None
        self.install_platbase = None
        self.root = None

        # These options are the actual installation directories; if not
        # supplied by the user, they are filled in using the installation
        # scheme implied by prefix/exec-prefix/home and the contents of
        # that installation scheme.
        self.install_purelib = None     # for pure module distributions
        self.install_platlib = None     # non-pure (dists w/ extensions)
        self.install_headers = None     # for C/C++ headers
        self.install_lib = None         # set to either purelib or platlib
        self.install_scripts = None
        self.install_data = None
        self.install_userbase = USER_BASE
        self.install_usersite = USER_SITE

        self.compile = None
        self.optimize = None

        # Deprecated
        # These two are for putting non-packagized distributions into their
        # own directory and creating a .pth file if it makes sense.
        # 'extra_path' comes from the setup file; 'install_path_file' can
        # be turned off if it makes no sense to install a .pth file.  (But
        # better to install it uselessly than to guess wrong and not
        # install it when it's necessary and would be used!)  Currently,
        # 'install_path_file' is always true unless some outsider meddles
        # with it.
        self.extra_path = None
        self.install_path_file = 1

        # 'force' forces installation, even if target files are not
        # out-of-date.  'skip_build' skips running the "build" command,
        # handy if you know it's not necessary.  'warn_dir' (which is *not*
        # a user option, it's just there so the bdist_* commands can turn
        # it off) determines whether we warn about installing to a
        # directory not in sys.path.
        self.force = 0
        self.skip_build = 0
        self.warn_dir = 1

        # These are only here as a conduit from the 'build' command to the
        # 'install_*' commands that do the real work.  ('build_base' isn't
        # actually used anywhere, but it might be useful in future.)  They
        # are not user options, because if the user told the install
        # command where the build directory is, that wouldn't affect the
        # build command.
        self.build_base = None
        self.build_lib = None

        # Not defined yet because we don't know anything about
        # documentation yet.
        #self.install_man = None
        #self.install_html = None
        #self.install_info = None

        self.record = None


    # -- Option finalizing methods -------------------------------------
    # (This is rather more involved than for most commands,
    # because this is where the policy for installing third-
    # party Python modules on various platforms given a wide
    # array of user input is decided.  Yes, it's quite complex!)

    def finalize_options(self):
        """Finalizes options."""
        # This method (and its helpers, like 'finalize_unix()',
        # 'finalize_other()', and 'select_scheme()') is where the default
        # installation directories for modules, extension modules, and
        # anything else we care to install from a Python module
        # distribution.  Thus, this code makes a pretty important policy
        # statement about how third-party stuff is added to a Python
        # installation!  Note that the actual work of installation is done
        # by the relatively simple 'install_*' commands; they just take
        # their orders from the installation directory options determined
        # here.

        # Check for errors/inconsistencies in the options; first, stuff
        # that's wrong on any platform.

        if ((self.prefix or self.exec_prefix or self.home) and
            (self.install_base or self.install_platbase)):
            raise DistutilsOptionError(
                   "must supply either prefix/exec-prefix/home or " +
                   "install-base/install-platbase -- not both")

        if self.home and (self.prefix or self.exec_prefix):
            raise DistutilsOptionError(
                  "must supply either home or prefix/exec-prefix -- not both")

        if self.user and (self.prefix or self.exec_prefix or self.home or
                self.install_base or self.install_platbase):
            raise DistutilsOptionError("can't combine user with prefix, "
                                       "exec_prefix/home, or install_(plat)base")

        # Next, stuff that's wrong (or dubious) only on certain platforms.
        if os.name != "posix":
            if self.exec_prefix:
                self.warn("exec-prefix option ignored on this platform")
                self.exec_prefix = None

        # Now the interesting logic -- so interesting that we farm it out
        # to other methods.  The goal of these methods is to set the final
        # values for the install_{lib,scripts,data,...}  options, using as
        # input a heady brew of prefix, exec_prefix, home, install_base,
        # install_platbase, user-supplied versions of
        # install_{purelib,platlib,lib,scripts,data,...}, and the
        # INSTALL_SCHEME dictionary above.  Phew!

        self.dump_dirs("pre-finalize_{unix,other}")

        if os.name == 'posix':
            self.finalize_unix()
        else:
            self.finalize_other()

        self.dump_dirs("post-finalize_{unix,other}()")

        # Expand configuration variables, tilde, etc. in self.install_base
        # and self.install_platbase -- that way, we can use $base or
        # $platbase in the other installation directories and not worry
        # about needing recursive variable expansion (shudder).

        py_version = sys.version.split()[0]
        (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix')
        try:
            abiflags = sys.abiflags
        except AttributeError:
            # sys.abiflags may not be defined on all platforms.
            abiflags = ''
        self.config_vars = {'dist_name': self.distribution.get_name(),
                            'dist_version': self.distribution.get_version(),
                            'dist_fullname': self.distribution.get_fullname(),
                            'py_version': py_version,
                            'py_version_short': '%d.%d' % sys.version_info[:2],
                            'py_version_nodot': '%d%d' % sys.version_info[:2],
                            'sys_prefix': prefix,
                            'prefix': prefix,
                            'sys_exec_prefix': exec_prefix,
                            'exec_prefix': exec_prefix,
                            'abiflags': abiflags,
                           }

        if HAS_USER_SITE:
            self.config_vars['userbase'] = self.install_userbase
            self.config_vars['usersite'] = self.install_usersite

        self.expand_basedirs()

        self.dump_dirs("post-expand_basedirs()")

        # Now define config vars for the base directories so we can expand
        # everything else.
        self.config_vars['base'] = self.install_base
        self.config_vars['platbase'] = self.install_platbase

        if DEBUG:
            from pprint import pprint
            print("config vars:")
            pprint(self.config_vars)

        # Expand "~" and configuration variables in the installation
        # directories.
        self.expand_dirs()

        self.dump_dirs("post-expand_dirs()")

        # Create directories in the home dir:
        if self.user:
            self.create_home_path()

        # Pick the actual directory to install all modules to: either
        # install_purelib or install_platlib, depending on whether this
        # module distribution is pure or not.  Of course, if the user
        # already specified install_lib, use their selection.
        if self.install_lib is None:
            if self.distribution.ext_modules: # has extensions: non-pure
                self.install_lib = self.install_platlib
            else:
                self.install_lib = self.install_purelib


        # Convert directories from Unix /-separated syntax to the local
        # convention.
        self.convert_paths('lib', 'purelib', 'platlib',
                           'scripts', 'data', 'headers',
                           'userbase', 'usersite')

        # Deprecated
        # Well, we're not actually fully completely finalized yet: we still
        # have to deal with 'extra_path', which is the hack for allowing
        # non-packagized module distributions (hello, Numerical Python!) to
        # get their own directories.
        self.handle_extra_path()
        self.install_libbase = self.install_lib # needed for .pth file
        self.install_lib = os.path.join(self.install_lib, self.extra_dirs)

        # If a new root directory was supplied, make all the installation
        # dirs relative to it.
        if self.root is not None:
            self.change_roots('libbase', 'lib', 'purelib', 'platlib',
                              'scripts', 'data', 'headers')

        self.dump_dirs("after prepending root")

        # Find out the build directories, ie. where to install from.
        self.set_undefined_options('build',
                                   ('build_base', 'build_base'),
                                   ('build_lib', 'build_lib'))

        # Punt on doc directories for now -- after all, we're punting on
        # documentation completely!

    def dump_dirs(self, msg):
        """Dumps the list of user options."""
        if not DEBUG:
            return
        from distutils.fancy_getopt import longopt_xlate
        log.debug(msg + ":")
        for opt in self.user_options:
            opt_name = opt[0]
            if opt_name[-1] == "=":
                opt_name = opt_name[0:-1]
            if opt_name in self.negative_opt:
                opt_name = self.negative_opt[opt_name]
                opt_name = opt_name.translate(longopt_xlate)
                val = not getattr(self, opt_name)
            else:
                opt_name = opt_name.translate(longopt_xlate)
                val = getattr(self, opt_name)
            log.debug("  %s: %s", opt_name, val)

    def finalize_unix(self):
        """Finalizes options for posix platforms."""
        if self.install_base is not None or self.install_platbase is not None:
            if ((self.install_lib is None and
                 self.install_purelib is None and
                 self.install_platlib is None) or
                self.install_headers is None or
                self.install_scripts is None or
                self.install_data is None):
                raise DistutilsOptionError(
                      "install-base or install-platbase supplied, but "
                      "installation scheme is incomplete")
            return

        if self.user:
            if self.install_userbase is None:
                raise DistutilsPlatformError(
                    "User base directory is not specified")
            self.install_base = self.install_platbase = self.install_userbase
            self.select_scheme("unix_user")
        elif self.home is not None:
            self.install_base = self.install_platbase = self.home
            self.select_scheme("unix_home")
        else:
            if self.prefix is None:
                if self.exec_prefix is not None:
                    raise DistutilsOptionError(
                          "must not supply exec-prefix without prefix")

                # self.prefix is set to sys.prefix + /local/
                # if neither RPM build nor virtual environment is
                # detected to make pip and distutils install packages
                # into the separate location.
                if (not (hasattr(sys, 'real_prefix') or
                    sys.prefix != sys.base_prefix) and
                    'RPM_BUILD_ROOT' not in os.environ):
                    addition = "/local"
                else:
                    addition = ""

                self.prefix = os.path.normpath(sys.prefix) + addition
                self.exec_prefix = os.path.normpath(sys.exec_prefix) + addition

            else:
                if self.exec_prefix is None:
                    self.exec_prefix = self.prefix

            self.install_base = self.prefix
            self.install_platbase = self.exec_prefix
            self.select_scheme("unix_prefix")

    def finalize_other(self):
        """Finalizes options for non-posix platforms"""
        if self.user:
            if self.install_userbase is None:
                raise DistutilsPlatformError(
                    "User base directory is not specified")
            self.install_base = self.install_platbase = self.install_userbase
            self.select_scheme(os.name + "_user")
        elif self.home is not None:
            self.install_base = self.install_platbase = self.home
            self.select_scheme("unix_home")
        else:
            if self.prefix is None:
                self.prefix = os.path.normpath(sys.prefix)

            self.install_base = self.install_platbase = self.prefix
            try:
                self.select_scheme(os.name)
            except KeyError:
                raise DistutilsPlatformError(
                      "I don't know how to install stuff on '%s'" % os.name)

    def select_scheme(self, name):
        """Sets the install directories by applying the install schemes."""
        # it's the caller's problem if they supply a bad name!
        scheme = INSTALL_SCHEMES[name]
        for key in SCHEME_KEYS:
            attrname = 'install_' + key
            if getattr(self, attrname) is None:
                setattr(self, attrname, scheme[key])

    def _expand_attrs(self, attrs):
        for attr in attrs:
            val = getattr(self, attr)
            if val is not None:
                if os.name == 'posix' or os.name == 'nt':
                    val = os.path.expanduser(val)
                val = subst_vars(val, self.config_vars)
                setattr(self, attr, val)

    def expand_basedirs(self):
        """Calls `os.path.expanduser` on install_base, install_platbase and
        root."""
        self._expand_attrs(['install_base', 'install_platbase', 'root'])

    def expand_dirs(self):
        """Calls `os.path.expanduser` on install dirs."""
        self._expand_attrs(['install_purelib', 'install_platlib',
                            'install_lib', 'install_headers',
                            'install_scripts', 'install_data',])

    def convert_paths(self, *names):
        """Call `convert_path` over `names`."""
        for name in names:
            attr = "install_" + name
            setattr(self, attr, convert_path(getattr(self, attr)))

    def handle_extra_path(self):
        """Set `path_file` and `extra_dirs` using `extra_path`."""
        if self.extra_path is None:
            self.extra_path = self.distribution.extra_path

        if self.extra_path is not None:
            log.warn(
                "Distribution option extra_path is deprecated. "
                "See issue27919 for details."
            )
            if isinstance(self.extra_path, str):
                self.extra_path = self.extra_path.split(',')

            if len(self.extra_path) == 1:
                path_file = extra_dirs = self.extra_path[0]
            elif len(self.extra_path) == 2:
                path_file, extra_dirs = self.extra_path
            else:
                raise DistutilsOptionError(
                      "'extra_path' option must be a list, tuple, or "
                      "comma-separated string with 1 or 2 elements")

            # convert to local form in case Unix notation used (as it
            # should be in setup scripts)
            extra_dirs = convert_path(extra_dirs)
        else:
            path_file = None
            extra_dirs = ''

        # XXX should we warn if path_file and not extra_dirs? (in which
        # case the path file would be harmless but pointless)
        self.path_file = path_file
        self.extra_dirs = extra_dirs

    def change_roots(self, *names):
        """Change the install directories pointed by name using root."""
        for name in names:
            attr = "install_" + name
            setattr(self, attr, change_root(self.root, getattr(self, attr)))

    def create_home_path(self):
        """Create directories under ~."""
        if not self.user:
            return
        home = convert_path(os.path.expanduser("~"))
        for name, path in self.config_vars.items():
            if path.startswith(home) and not os.path.isdir(path):
                self.debug_print("os.makedirs('%s', 0o700)" % path)
                os.makedirs(path, 0o700)

    # -- Command execution methods -------------------------------------

    def run(self):
        """Runs the command."""
        # Obviously have to build before we can install
        if not self.skip_build:
            self.run_command('build')
            # If we built for any other platform, we can't install.
            build_plat = self.distribution.get_command_obj('build').plat_name
            # check warn_dir - it is a clue that the 'install' is happening
            # internally, and not to sys.path, so we don't check the platform
            # matches what we are running.
            if self.warn_dir and build_plat != get_platform():
                raise DistutilsPlatformError("Can't install when "
                                             "cross-compiling")

        # Run all sub-commands (at least those that need to be run)
        for cmd_name in self.get_sub_commands():
            self.run_command(cmd_name)

        if self.path_file:
            self.create_path_file()

        # write list of installed files, if requested.
        if self.record:
            outputs = self.get_outputs()
            if self.root:               # strip any package prefix
                root_len = len(self.root)
                for counter in range(len(outputs)):
                    outputs[counter] = outputs[counter][root_len:]
            self.execute(write_file,
                         (self.record, outputs),
                         "writing list of installed files to '%s'" %
                         self.record)

        sys_path = map(os.path.normpath, sys.path)
        sys_path = map(os.path.normcase, sys_path)
        install_lib = os.path.normcase(os.path.normpath(self.install_lib))
        if (self.warn_dir and
            not (self.path_file and self.install_path_file) and
            install_lib not in sys_path):
            log.debug(("modules installed to '%s', which is not in "
                       "Python's module search path (sys.path) -- "
                       "you'll have to change the search path yourself"),
                       self.install_lib)

    def create_path_file(self):
        """Creates the .pth file"""
        filename = os.path.join(self.install_libbase,
                                self.path_file + ".pth")
        if self.install_path_file:
            self.execute(write_file,
                         (filename, [self.extra_dirs]),
                         "creating %s" % filename)
        else:
            self.warn("path file '%s' not created" % filename)


    # -- Reporting methods ---------------------------------------------

    def get_outputs(self):
        """Assembles the outputs of all the sub-commands."""
        outputs = []
        for cmd_name in self.get_sub_commands():
            cmd = self.get_finalized_command(cmd_name)
            # Add the contents of cmd.get_outputs(), ensuring
            # that outputs doesn't contain duplicate entries
            for filename in cmd.get_outputs():
                if filename not in outputs:
                    outputs.append(filename)

        if self.path_file and self.install_path_file:
            outputs.append(os.path.join(self.install_libbase,
                                        self.path_file + ".pth"))

        return outputs

    def get_inputs(self):
        """Returns the inputs of all the sub-commands"""
        # XXX gee, this looks familiar ;-(
        inputs = []
        for cmd_name in self.get_sub_commands():
            cmd = self.get_finalized_command(cmd_name)
            inputs.extend(cmd.get_inputs())

        return inputs

    # -- Predicates for sub-command list -------------------------------

    def has_lib(self):
        """Returns true if the current distribution has any Python
        modules to install."""
        return (self.distribution.has_pure_modules() or
                self.distribution.has_ext_modules())

    def has_headers(self):
        """Returns true if the current distribution has any headers to
        install."""
        return self.distribution.has_headers()

    def has_scripts(self):
        """Returns true if the current distribution has any scripts to.
        install."""
        return self.distribution.has_scripts()

    def has_data(self):
        """Returns true if the current distribution has any data to.
        install."""
        return self.distribution.has_data_files()

    # 'sub_commands': a list of commands this command might have to run to
    # get its work done.  See cmd.py for more info.
    sub_commands = [('install_lib',     has_lib),
                    ('install_headers', has_headers),
                    ('install_scripts', has_scripts),
                    ('install_data',    has_data),
                    ('install_egg_info', lambda self:True),
                   ]
install_egg_info.py000064400000005053150513660020010422 0ustar00"""distutils.command.install_egg_info

Implements the Distutils 'install_egg_info' command, for installing
a package's PKG-INFO metadata."""


from distutils.cmd import Command
from distutils import log, dir_util
import os, sys, re

class install_egg_info(Command):
    """Install an .egg-info file for the package"""

    description = "Install package's PKG-INFO metadata as an .egg-info file"
    user_options = [
        ('install-dir=', 'd', "directory to install to"),
    ]

    def initialize_options(self):
        self.install_dir = None

    def finalize_options(self):
        self.set_undefined_options('install_lib',('install_dir','install_dir'))
        basename = "%s-%s-py%d.%d.egg-info" % (
            to_filename(safe_name(self.distribution.get_name())),
            to_filename(safe_version(self.distribution.get_version())),
            *sys.version_info[:2]
        )
        self.target = os.path.join(self.install_dir, basename)
        self.outputs = [self.target]

    def run(self):
        target = self.target
        if os.path.isdir(target) and not os.path.islink(target):
            dir_util.remove_tree(target, dry_run=self.dry_run)
        elif os.path.exists(target):
            self.execute(os.unlink,(self.target,),"Removing "+target)
        elif not os.path.isdir(self.install_dir):
            self.execute(os.makedirs, (self.install_dir,),
                         "Creating "+self.install_dir)
        log.info("Writing %s", target)
        if not self.dry_run:
            with open(target, 'w', encoding='UTF-8') as f:
                self.distribution.metadata.write_pkg_file(f)

    def get_outputs(self):
        return self.outputs


# The following routines are taken from setuptools' pkg_resources module and
# can be replaced by importing them from pkg_resources once it is included
# in the stdlib.

def safe_name(name):
    """Convert an arbitrary string to a standard distribution name

    Any runs of non-alphanumeric/. characters are replaced with a single '-'.
    """
    return re.sub('[^A-Za-z0-9.]+', '-', name)


def safe_version(version):
    """Convert an arbitrary string to a standard version string

    Spaces become dots, and all other non-alphanumeric characters become
    dashes, with runs of multiple dashes condensed to a single dash.
    """
    version = version.replace(' ','.')
    return re.sub('[^A-Za-z0-9.]+', '-', version)


def to_filename(name):
    """Convert a project or version name to its filename-escaped form

    Any '-' characters are currently replaced with '_'.
    """
    return name.replace('-','_')
command_template000064400000001171150513660020007776 0ustar00"""distutils.command.x

Implements the Distutils 'x' command.
"""

# created 2000/mm/dd, John Doe

__revision__ = "$Id$"

from distutils.core import Command


class x(Command):

    # Brief (40-50 characters) description of the command
    description = ""

    # List of option tuples: long name, short name (None if no short
    # name), and help string.
    user_options = [('', '',
                     ""),
                   ]

    def initialize_options(self):
        self. = None
        self. = None
        self. = None

    def finalize_options(self):
        if self.x is None:
            self.x = 

    def run(self):
build_scripts.py000064400000014130150513660020007761 0ustar00"""distutils.command.build_scripts

Implements the Distutils 'build_scripts' command."""

import os, re
from stat import ST_MODE
from distutils import sysconfig
from distutils.core import Command
from distutils.dep_util import newer
from distutils.util import convert_path, Mixin2to3
from distutils import log
import tokenize

# check if Python is called on the first line with this expression
first_line_re = re.compile(b'^#!.*python[0-9.]*([ \t].*)?$')

class build_scripts(Command):

    description = "\"build\" scripts (copy and fixup #! line)"

    user_options = [
        ('build-dir=', 'd', "directory to \"build\" (copy) to"),
        ('force', 'f', "forcibly build everything (ignore file timestamps"),
        ('executable=', 'e', "specify final destination interpreter path"),
        ]

    boolean_options = ['force']


    def initialize_options(self):
        self.build_dir = None
        self.scripts = None
        self.force = None
        self.executable = None
        self.outfiles = None

    def finalize_options(self):
        self.set_undefined_options('build',
                                   ('build_scripts', 'build_dir'),
                                   ('force', 'force'),
                                   ('executable', 'executable'))
        self.scripts = self.distribution.scripts

    def get_source_files(self):
        return self.scripts

    def run(self):
        if not self.scripts:
            return
        self.copy_scripts()


    def copy_scripts(self):
        r"""Copy each script listed in 'self.scripts'; if it's marked as a
        Python script in the Unix way (first line matches 'first_line_re',
        ie. starts with "\#!" and contains "python"), then adjust the first
        line to refer to the current Python interpreter as we copy.
        """
        self.mkpath(self.build_dir)
        outfiles = []
        updated_files = []
        for script in self.scripts:
            adjust = False
            script = convert_path(script)
            outfile = os.path.join(self.build_dir, os.path.basename(script))
            outfiles.append(outfile)

            if not self.force and not newer(script, outfile):
                log.debug("not copying %s (up-to-date)", script)
                continue

            # Always open the file, but ignore failures in dry-run mode --
            # that way, we'll get accurate feedback if we can read the
            # script.
            try:
                f = open(script, "rb")
            except OSError:
                if not self.dry_run:
                    raise
                f = None
            else:
                encoding, lines = tokenize.detect_encoding(f.readline)
                f.seek(0)
                first_line = f.readline()
                if not first_line:
                    self.warn("%s is an empty file (skipping)" % script)
                    continue

                match = first_line_re.match(first_line)
                if match:
                    adjust = True
                    post_interp = match.group(1) or b''

            if adjust:
                log.info("copying and adjusting %s -> %s", script,
                         self.build_dir)
                updated_files.append(outfile)
                if not self.dry_run:
                    if not sysconfig.python_build:
                        executable = self.executable
                    else:
                        executable = os.path.join(
                            sysconfig.get_config_var("BINDIR"),
                           "python%s%s" % (sysconfig.get_config_var("VERSION"),
                                           sysconfig.get_config_var("EXE")))
                    executable = os.fsencode(executable)
                    shebang = b"#!" + executable + post_interp + b"\n"
                    # Python parser starts to read a script using UTF-8 until
                    # it gets a #coding:xxx cookie. The shebang has to be the
                    # first line of a file, the #coding:xxx cookie cannot be
                    # written before. So the shebang has to be decodable from
                    # UTF-8.
                    try:
                        shebang.decode('utf-8')
                    except UnicodeDecodeError:
                        raise ValueError(
                            "The shebang ({!r}) is not decodable "
                            "from utf-8".format(shebang))
                    # If the script is encoded to a custom encoding (use a
                    # #coding:xxx cookie), the shebang has to be decodable from
                    # the script encoding too.
                    try:
                        shebang.decode(encoding)
                    except UnicodeDecodeError:
                        raise ValueError(
                            "The shebang ({!r}) is not decodable "
                            "from the script encoding ({})"
                            .format(shebang, encoding))
                    with open(outfile, "wb") as outf:
                        outf.write(shebang)
                        outf.writelines(f.readlines())
                if f:
                    f.close()
            else:
                if f:
                    f.close()
                updated_files.append(outfile)
                self.copy_file(script, outfile)

        if os.name == 'posix':
            for file in outfiles:
                if self.dry_run:
                    log.info("changing mode of %s", file)
                else:
                    oldmode = os.stat(file)[ST_MODE] & 0o7777
                    newmode = (oldmode | 0o555) & 0o7777
                    if newmode != oldmode:
                        log.info("changing mode of %s from %o to %o",
                                 file, oldmode, newmode)
                        os.chmod(file, newmode)
        # XXX should we modify self.outfiles?
        return outfiles, updated_files

class build_scripts_2to3(build_scripts, Mixin2to3):

    def copy_scripts(self):
        outfiles, updated_files = build_scripts.copy_scripts(self)
        if not self.dry_run:
            self.run_2to3(updated_files)
        return outfiles, updated_files
bdist_dumb.py000064400000011461150513660020007233 0ustar00"""distutils.command.bdist_dumb

Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix)."""

import os
from distutils.core import Command
from distutils.util import get_platform
from distutils.dir_util import remove_tree, ensure_relative
from distutils.errors import *
from distutils.sysconfig import get_python_version
from distutils import log

class bdist_dumb(Command):

    description = "create a \"dumb\" built distribution"

    user_options = [('bdist-dir=', 'd',
                     "temporary directory for creating the distribution"),
                    ('plat-name=', 'p',
                     "platform name to embed in generated filenames "
                     "(default: %s)" % get_platform()),
                    ('format=', 'f',
                     "archive format to create (tar, gztar, bztar, xztar, "
                     "ztar, zip)"),
                    ('keep-temp', 'k',
                     "keep the pseudo-installation tree around after " +
                     "creating the distribution archive"),
                    ('dist-dir=', 'd',
                     "directory to put final built distributions in"),
                    ('skip-build', None,
                     "skip rebuilding everything (for testing/debugging)"),
                    ('relative', None,
                     "build the archive using relative paths "
                     "(default: false)"),
                    ('owner=', 'u',
                     "Owner name used when creating a tar file"
                     " [default: current user]"),
                    ('group=', 'g',
                     "Group name used when creating a tar file"
                     " [default: current group]"),
                   ]

    boolean_options = ['keep-temp', 'skip-build', 'relative']

    default_format = { 'posix': 'gztar',
                       'nt': 'zip' }

    def initialize_options(self):
        self.bdist_dir = None
        self.plat_name = None
        self.format = None
        self.keep_temp = 0
        self.dist_dir = None
        self.skip_build = None
        self.relative = 0
        self.owner = None
        self.group = None

    def finalize_options(self):
        if self.bdist_dir is None:
            bdist_base = self.get_finalized_command('bdist').bdist_base
            self.bdist_dir = os.path.join(bdist_base, 'dumb')

        if self.format is None:
            try:
                self.format = self.default_format[os.name]
            except KeyError:
                raise DistutilsPlatformError(
                       "don't know how to create dumb built distributions "
                       "on platform %s" % os.name)

        self.set_undefined_options('bdist',
                                   ('dist_dir', 'dist_dir'),
                                   ('plat_name', 'plat_name'),
                                   ('skip_build', 'skip_build'))

    def run(self):
        if not self.skip_build:
            self.run_command('build')

        install = self.reinitialize_command('install', reinit_subcommands=1)
        install.root = self.bdist_dir
        install.skip_build = self.skip_build
        install.warn_dir = 0

        log.info("installing to %s", self.bdist_dir)
        self.run_command('install')

        # And make an archive relative to the root of the
        # pseudo-installation tree.
        archive_basename = "%s.%s" % (self.distribution.get_fullname(),
                                      self.plat_name)

        pseudoinstall_root = os.path.join(self.dist_dir, archive_basename)
        if not self.relative:
            archive_root = self.bdist_dir
        else:
            if (self.distribution.has_ext_modules() and
                (install.install_base != install.install_platbase)):
                raise DistutilsPlatformError(
                       "can't make a dumb built distribution where "
                       "base and platbase are different (%s, %s)"
                       % (repr(install.install_base),
                          repr(install.install_platbase)))
            else:
                archive_root = os.path.join(self.bdist_dir,
                                   ensure_relative(install.install_base))

        # Make the archive
        filename = self.make_archive(pseudoinstall_root,
                                     self.format, root_dir=archive_root,
                                     owner=self.owner, group=self.group)
        if self.distribution.has_ext_modules():
            pyversion = get_python_version()
        else:
            pyversion = 'any'
        self.distribution.dist_files.append(('bdist_dumb', pyversion,
                                             filename))

        if not self.keep_temp:
            remove_tree(self.bdist_dir, dry_run=self.dry_run)
bdist_msi.py000064400000104737150513660020007105 0ustar00# Copyright (C) 2005, 2006 Martin von Löwis
# Licensed to PSF under a Contributor Agreement.
# The bdist_wininst command proper
# based on bdist_wininst
"""
Implements the bdist_msi command.
"""

import sys, os
from distutils.core import Command
from distutils.dir_util import remove_tree
from distutils.sysconfig import get_python_version
from distutils.version import StrictVersion
from distutils.errors import DistutilsOptionError
from distutils.util import get_platform
from distutils import log
import msilib
from msilib import schema, sequence, text
from msilib import Directory, Feature, Dialog, add_data

class PyDialog(Dialog):
    """Dialog class with a fixed layout: controls at the top, then a ruler,
    then a list of buttons: back, next, cancel. Optionally a bitmap at the
    left."""
    def __init__(self, *args, **kw):
        """Dialog(database, name, x, y, w, h, attributes, title, first,
        default, cancel, bitmap=true)"""
        Dialog.__init__(self, *args)
        ruler = self.h - 36
        bmwidth = 152*ruler/328
        #if kw.get("bitmap", True):
        #    self.bitmap("Bitmap", 0, 0, bmwidth, ruler, "PythonWin")
        self.line("BottomLine", 0, ruler, self.w, 0)

    def title(self, title):
        "Set the title text of the dialog at the top."
        # name, x, y, w, h, flags=Visible|Enabled|Transparent|NoPrefix,
        # text, in VerdanaBold10
        self.text("Title", 15, 10, 320, 60, 0x30003,
                  r"{\VerdanaBold10}%s" % title)

    def back(self, title, next, name = "Back", active = 1):
        """Add a back button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associated"""
        if active:
            flags = 3 # Visible|Enabled
        else:
            flags = 1 # Visible
        return self.pushbutton(name, 180, self.h-27 , 56, 17, flags, title, next)

    def cancel(self, title, next, name = "Cancel", active = 1):
        """Add a cancel button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associated"""
        if active:
            flags = 3 # Visible|Enabled
        else:
            flags = 1 # Visible
        return self.pushbutton(name, 304, self.h-27, 56, 17, flags, title, next)

    def next(self, title, next, name = "Next", active = 1):
        """Add a Next button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associated"""
        if active:
            flags = 3 # Visible|Enabled
        else:
            flags = 1 # Visible
        return self.pushbutton(name, 236, self.h-27, 56, 17, flags, title, next)

    def xbutton(self, name, title, next, xpos):
        """Add a button with a given title, the tab-next button,
        its name in the Control table, giving its x position; the
        y-position is aligned with the other buttons.

        Return the button, so that events can be associated"""
        return self.pushbutton(name, int(self.w*xpos - 28), self.h-27, 56, 17, 3, title, next)

class bdist_msi(Command):

    description = "create a Microsoft Installer (.msi) binary distribution"

    user_options = [('bdist-dir=', None,
                     "temporary directory for creating the distribution"),
                    ('plat-name=', 'p',
                     "platform name to embed in generated filenames "
                     "(default: %s)" % get_platform()),
                    ('keep-temp', 'k',
                     "keep the pseudo-installation tree around after " +
                     "creating the distribution archive"),
                    ('target-version=', None,
                     "require a specific python version" +
                     " on the target system"),
                    ('no-target-compile', 'c',
                     "do not compile .py to .pyc on the target system"),
                    ('no-target-optimize', 'o',
                     "do not compile .py to .pyo (optimized) "
                     "on the target system"),
                    ('dist-dir=', 'd',
                     "directory to put final built distributions in"),
                    ('skip-build', None,
                     "skip rebuilding everything (for testing/debugging)"),
                    ('install-script=', None,
                     "basename of installation script to be run after "
                     "installation or before deinstallation"),
                    ('pre-install-script=', None,
                     "Fully qualified filename of a script to be run before "
                     "any files are installed.  This script need not be in the "
                     "distribution"),
                   ]

    boolean_options = ['keep-temp', 'no-target-compile', 'no-target-optimize',
                       'skip-build']

    all_versions = ['2.0', '2.1', '2.2', '2.3', '2.4',
                    '2.5', '2.6', '2.7', '2.8', '2.9',
                    '3.0', '3.1', '3.2', '3.3', '3.4',
                    '3.5', '3.6', '3.7', '3.8', '3.9']
    other_version = 'X'

    def initialize_options(self):
        self.bdist_dir = None
        self.plat_name = None
        self.keep_temp = 0
        self.no_target_compile = 0
        self.no_target_optimize = 0
        self.target_version = None
        self.dist_dir = None
        self.skip_build = None
        self.install_script = None
        self.pre_install_script = None
        self.versions = None

    def finalize_options(self):
        self.set_undefined_options('bdist', ('skip_build', 'skip_build'))

        if self.bdist_dir is None:
            bdist_base = self.get_finalized_command('bdist').bdist_base
            self.bdist_dir = os.path.join(bdist_base, 'msi')

        short_version = get_python_version()
        if (not self.target_version) and self.distribution.has_ext_modules():
            self.target_version = short_version

        if self.target_version:
            self.versions = [self.target_version]
            if not self.skip_build and self.distribution.has_ext_modules()\
               and self.target_version != short_version:
                raise DistutilsOptionError(
                      "target version can only be %s, or the '--skip-build'"
                      " option must be specified" % (short_version,))
        else:
            self.versions = list(self.all_versions)

        self.set_undefined_options('bdist',
                                   ('dist_dir', 'dist_dir'),
                                   ('plat_name', 'plat_name'),
                                   )

        if self.pre_install_script:
            raise DistutilsOptionError(
                  "the pre-install-script feature is not yet implemented")

        if self.install_script:
            for script in self.distribution.scripts:
                if self.install_script == os.path.basename(script):
                    break
            else:
                raise DistutilsOptionError(
                      "install_script '%s' not found in scripts"
                      % self.install_script)
        self.install_script_key = None

    def run(self):
        if not self.skip_build:
            self.run_command('build')

        install = self.reinitialize_command('install', reinit_subcommands=1)
        install.prefix = self.bdist_dir
        install.skip_build = self.skip_build
        install.warn_dir = 0

        install_lib = self.reinitialize_command('install_lib')
        # we do not want to include pyc or pyo files
        install_lib.compile = 0
        install_lib.optimize = 0

        if self.distribution.has_ext_modules():
            # If we are building an installer for a Python version other
            # than the one we are currently running, then we need to ensure
            # our build_lib reflects the other Python version rather than ours.
            # Note that for target_version!=sys.version, we must have skipped the
            # build step, so there is no issue with enforcing the build of this
            # version.
            target_version = self.target_version
            if not target_version:
                assert self.skip_build, "Should have already checked this"
                target_version = '%d.%d' % sys.version_info[:2]
            plat_specifier = ".%s-%s" % (self.plat_name, target_version)
            build = self.get_finalized_command('build')
            build.build_lib = os.path.join(build.build_base,
                                           'lib' + plat_specifier)

        log.info("installing to %s", self.bdist_dir)
        install.ensure_finalized()

        # avoid warning of 'install_lib' about installing
        # into a directory not in sys.path
        sys.path.insert(0, os.path.join(self.bdist_dir, 'PURELIB'))

        install.run()

        del sys.path[0]

        self.mkpath(self.dist_dir)
        fullname = self.distribution.get_fullname()
        installer_name = self.get_installer_filename(fullname)
        installer_name = os.path.abspath(installer_name)
        if os.path.exists(installer_name): os.unlink(installer_name)

        metadata = self.distribution.metadata
        author = metadata.author
        if not author:
            author = metadata.maintainer
        if not author:
            author = "UNKNOWN"
        version = metadata.get_version()
        # ProductVersion must be strictly numeric
        # XXX need to deal with prerelease versions
        sversion = "%d.%d.%d" % StrictVersion(version).version
        # Prefix ProductName with Python x.y, so that
        # it sorts together with the other Python packages
        # in Add-Remove-Programs (APR)
        fullname = self.distribution.get_fullname()
        if self.target_version:
            product_name = "Python %s %s" % (self.target_version, fullname)
        else:
            product_name = "Python %s" % (fullname)
        self.db = msilib.init_database(installer_name, schema,
                product_name, msilib.gen_uuid(),
                sversion, author)
        msilib.add_tables(self.db, sequence)
        props = [('DistVersion', version)]
        email = metadata.author_email or metadata.maintainer_email
        if email:
            props.append(("ARPCONTACT", email))
        if metadata.url:
            props.append(("ARPURLINFOABOUT", metadata.url))
        if props:
            add_data(self.db, 'Property', props)

        self.add_find_python()
        self.add_files()
        self.add_scripts()
        self.add_ui()
        self.db.Commit()

        if hasattr(self.distribution, 'dist_files'):
            tup = 'bdist_msi', self.target_version or 'any', fullname
            self.distribution.dist_files.append(tup)

        if not self.keep_temp:
            remove_tree(self.bdist_dir, dry_run=self.dry_run)

    def add_files(self):
        db = self.db
        cab = msilib.CAB("distfiles")
        rootdir = os.path.abspath(self.bdist_dir)

        root = Directory(db, cab, None, rootdir, "TARGETDIR", "SourceDir")
        f = Feature(db, "Python", "Python", "Everything",
                    0, 1, directory="TARGETDIR")

        items = [(f, root, '')]
        for version in self.versions + [self.other_version]:
            target = "TARGETDIR" + version
            name = default = "Python" + version
            desc = "Everything"
            if version is self.other_version:
                title = "Python from another location"
                level = 2
            else:
                title = "Python %s from registry" % version
                level = 1
            f = Feature(db, name, title, desc, 1, level, directory=target)
            dir = Directory(db, cab, root, rootdir, target, default)
            items.append((f, dir, version))
        db.Commit()

        seen = {}
        for feature, dir, version in items:
            todo = [dir]
            while todo:
                dir = todo.pop()
                for file in os.listdir(dir.absolute):
                    afile = os.path.join(dir.absolute, file)
                    if os.path.isdir(afile):
                        short = "%s|%s" % (dir.make_short(file), file)
                        default = file + version
                        newdir = Directory(db, cab, dir, file, default, short)
                        todo.append(newdir)
                    else:
                        if not dir.component:
                            dir.start_component(dir.logical, feature, 0)
                        if afile not in seen:
                            key = seen[afile] = dir.add_file(file)
                            if file==self.install_script:
                                if self.install_script_key:
                                    raise DistutilsOptionError(
                                          "Multiple files with name %s" % file)
                                self.install_script_key = '[#%s]' % key
                        else:
                            key = seen[afile]
                            add_data(self.db, "DuplicateFile",
                                [(key + version, dir.component, key, None, dir.logical)])
            db.Commit()
        cab.commit(db)

    def add_find_python(self):
        """Adds code to the installer to compute the location of Python.

        Properties PYTHON.MACHINE.X.Y and PYTHON.USER.X.Y will be set from the
        registry for each version of Python.

        Properties TARGETDIRX.Y will be set from PYTHON.USER.X.Y if defined,
        else from PYTHON.MACHINE.X.Y.

        Properties PYTHONX.Y will be set to TARGETDIRX.Y\\python.exe"""

        start = 402
        for ver in self.versions:
            install_path = r"SOFTWARE\Python\PythonCore\%s\InstallPath" % ver
            machine_reg = "python.machine." + ver
            user_reg = "python.user." + ver
            machine_prop = "PYTHON.MACHINE." + ver
            user_prop = "PYTHON.USER." + ver
            machine_action = "PythonFromMachine" + ver
            user_action = "PythonFromUser" + ver
            exe_action = "PythonExe" + ver
            target_dir_prop = "TARGETDIR" + ver
            exe_prop = "PYTHON" + ver
            if msilib.Win64:
                # type: msidbLocatorTypeRawValue + msidbLocatorType64bit
                Type = 2+16
            else:
                Type = 2
            add_data(self.db, "RegLocator",
                    [(machine_reg, 2, install_path, None, Type),
                     (user_reg, 1, install_path, None, Type)])
            add_data(self.db, "AppSearch",
                    [(machine_prop, machine_reg),
                     (user_prop, user_reg)])
            add_data(self.db, "CustomAction",
                    [(machine_action, 51+256, target_dir_prop, "[" + machine_prop + "]"),
                     (user_action, 51+256, target_dir_prop, "[" + user_prop + "]"),
                     (exe_action, 51+256, exe_prop, "[" + target_dir_prop + "]\\python.exe"),
                    ])
            add_data(self.db, "InstallExecuteSequence",
                    [(machine_action, machine_prop, start),
                     (user_action, user_prop, start + 1),
                     (exe_action, None, start + 2),
                    ])
            add_data(self.db, "InstallUISequence",
                    [(machine_action, machine_prop, start),
                     (user_action, user_prop, start + 1),
                     (exe_action, None, start + 2),
                    ])
            add_data(self.db, "Condition",
                    [("Python" + ver, 0, "NOT TARGETDIR" + ver)])
            start += 4
            assert start < 500

    def add_scripts(self):
        if self.install_script:
            start = 6800
            for ver in self.versions + [self.other_version]:
                install_action = "install_script." + ver
                exe_prop = "PYTHON" + ver
                add_data(self.db, "CustomAction",
                        [(install_action, 50, exe_prop, self.install_script_key)])
                add_data(self.db, "InstallExecuteSequence",
                        [(install_action, "&Python%s=3" % ver, start)])
                start += 1
        # XXX pre-install scripts are currently refused in finalize_options()
        #     but if this feature is completed, it will also need to add
        #     entries for each version as the above code does
        if self.pre_install_script:
            scriptfn = os.path.join(self.bdist_dir, "preinstall.bat")
            with open(scriptfn, "w") as f:
                # The batch file will be executed with [PYTHON], so that %1
                # is the path to the Python interpreter; %0 will be the path
                # of the batch file.
                # rem ="""
                # %1 %0
                # exit
                # """
                # <actual script>
                f.write('rem ="""\n%1 %0\nexit\n"""\n')
                with open(self.pre_install_script) as fin:
                    f.write(fin.read())
            add_data(self.db, "Binary",
                [("PreInstall", msilib.Binary(scriptfn))
                ])
            add_data(self.db, "CustomAction",
                [("PreInstall", 2, "PreInstall", None)
                ])
            add_data(self.db, "InstallExecuteSequence",
                    [("PreInstall", "NOT Installed", 450)])


    def add_ui(self):
        db = self.db
        x = y = 50
        w = 370
        h = 300
        title = "[ProductName] Setup"

        # see "Dialog Style Bits"
        modal = 3      # visible | modal
        modeless = 1   # visible
        track_disk_space = 32

        # UI customization properties
        add_data(db, "Property",
                 # See "DefaultUIFont Property"
                 [("DefaultUIFont", "DlgFont8"),
                  # See "ErrorDialog Style Bit"
                  ("ErrorDialog", "ErrorDlg"),
                  ("Progress1", "Install"),   # modified in maintenance type dlg
                  ("Progress2", "installs"),
                  ("MaintenanceForm_Action", "Repair"),
                  # possible values: ALL, JUSTME
                  ("WhichUsers", "ALL")
                 ])

        # Fonts, see "TextStyle Table"
        add_data(db, "TextStyle",
                 [("DlgFont8", "Tahoma", 9, None, 0),
                  ("DlgFontBold8", "Tahoma", 8, None, 1), #bold
                  ("VerdanaBold10", "Verdana", 10, None, 1),
                  ("VerdanaRed9", "Verdana", 9, 255, 0),
                 ])

        # UI Sequences, see "InstallUISequence Table", "Using a Sequence Table"
        # Numbers indicate sequence; see sequence.py for how these action integrate
        add_data(db, "InstallUISequence",
                 [("PrepareDlg", "Not Privileged or Windows9x or Installed", 140),
                  ("WhichUsersDlg", "Privileged and not Windows9x and not Installed", 141),
                  # In the user interface, assume all-users installation if privileged.
                  ("SelectFeaturesDlg", "Not Installed", 1230),
                  # XXX no support for resume installations yet
                  #("ResumeDlg", "Installed AND (RESUME OR Preselected)", 1240),
                  ("MaintenanceTypeDlg", "Installed AND NOT RESUME AND NOT Preselected", 1250),
                  ("ProgressDlg", None, 1280)])

        add_data(db, 'ActionText', text.ActionText)
        add_data(db, 'UIText', text.UIText)
        #####################################################################
        # Standard dialogs: FatalError, UserExit, ExitDialog
        fatal=PyDialog(db, "FatalError", x, y, w, h, modal, title,
                     "Finish", "Finish", "Finish")
        fatal.title("[ProductName] Installer ended prematurely")
        fatal.back("< Back", "Finish", active = 0)
        fatal.cancel("Cancel", "Back", active = 0)
        fatal.text("Description1", 15, 70, 320, 80, 0x30003,
                   "[ProductName] setup ended prematurely because of an error.  Your system has not been modified.  To install this program at a later time, please run the installation again.")
        fatal.text("Description2", 15, 155, 320, 20, 0x30003,
                   "Click the Finish button to exit the Installer.")
        c=fatal.next("Finish", "Cancel", name="Finish")
        c.event("EndDialog", "Exit")

        user_exit=PyDialog(db, "UserExit", x, y, w, h, modal, title,
                     "Finish", "Finish", "Finish")
        user_exit.title("[ProductName] Installer was interrupted")
        user_exit.back("< Back", "Finish", active = 0)
        user_exit.cancel("Cancel", "Back", active = 0)
        user_exit.text("Description1", 15, 70, 320, 80, 0x30003,
                   "[ProductName] setup was interrupted.  Your system has not been modified.  "
                   "To install this program at a later time, please run the installation again.")
        user_exit.text("Description2", 15, 155, 320, 20, 0x30003,
                   "Click the Finish button to exit the Installer.")
        c = user_exit.next("Finish", "Cancel", name="Finish")
        c.event("EndDialog", "Exit")

        exit_dialog = PyDialog(db, "ExitDialog", x, y, w, h, modal, title,
                             "Finish", "Finish", "Finish")
        exit_dialog.title("Completing the [ProductName] Installer")
        exit_dialog.back("< Back", "Finish", active = 0)
        exit_dialog.cancel("Cancel", "Back", active = 0)
        exit_dialog.text("Description", 15, 235, 320, 20, 0x30003,
                   "Click the Finish button to exit the Installer.")
        c = exit_dialog.next("Finish", "Cancel", name="Finish")
        c.event("EndDialog", "Return")

        #####################################################################
        # Required dialog: FilesInUse, ErrorDlg
        inuse = PyDialog(db, "FilesInUse",
                         x, y, w, h,
                         19,                # KeepModeless|Modal|Visible
                         title,
                         "Retry", "Retry", "Retry", bitmap=False)
        inuse.text("Title", 15, 6, 200, 15, 0x30003,
                   r"{\DlgFontBold8}Files in Use")
        inuse.text("Description", 20, 23, 280, 20, 0x30003,
               "Some files that need to be updated are currently in use.")
        inuse.text("Text", 20, 55, 330, 50, 3,
                   "The following applications are using files that need to be updated by this setup. Close these applications and then click Retry to continue the installation or Cancel to exit it.")
        inuse.control("List", "ListBox", 20, 107, 330, 130, 7, "FileInUseProcess",
                      None, None, None)
        c=inuse.back("Exit", "Ignore", name="Exit")
        c.event("EndDialog", "Exit")
        c=inuse.next("Ignore", "Retry", name="Ignore")
        c.event("EndDialog", "Ignore")
        c=inuse.cancel("Retry", "Exit", name="Retry")
        c.event("EndDialog","Retry")

        # See "Error Dialog". See "ICE20" for the required names of the controls.
        error = Dialog(db, "ErrorDlg",
                       50, 10, 330, 101,
                       65543,       # Error|Minimize|Modal|Visible
                       title,
                       "ErrorText", None, None)
        error.text("ErrorText", 50,9,280,48,3, "")
        #error.control("ErrorIcon", "Icon", 15, 9, 24, 24, 5242881, None, "py.ico", None, None)
        error.pushbutton("N",120,72,81,21,3,"No",None).event("EndDialog","ErrorNo")
        error.pushbutton("Y",240,72,81,21,3,"Yes",None).event("EndDialog","ErrorYes")
        error.pushbutton("A",0,72,81,21,3,"Abort",None).event("EndDialog","ErrorAbort")
        error.pushbutton("C",42,72,81,21,3,"Cancel",None).event("EndDialog","ErrorCancel")
        error.pushbutton("I",81,72,81,21,3,"Ignore",None).event("EndDialog","ErrorIgnore")
        error.pushbutton("O",159,72,81,21,3,"Ok",None).event("EndDialog","ErrorOk")
        error.pushbutton("R",198,72,81,21,3,"Retry",None).event("EndDialog","ErrorRetry")

        #####################################################################
        # Global "Query Cancel" dialog
        cancel = Dialog(db, "CancelDlg", 50, 10, 260, 85, 3, title,
                        "No", "No", "No")
        cancel.text("Text", 48, 15, 194, 30, 3,
                    "Are you sure you want to cancel [ProductName] installation?")
        #cancel.control("Icon", "Icon", 15, 15, 24, 24, 5242881, None,
        #               "py.ico", None, None)
        c=cancel.pushbutton("Yes", 72, 57, 56, 17, 3, "Yes", "No")
        c.event("EndDialog", "Exit")

        c=cancel.pushbutton("No", 132, 57, 56, 17, 3, "No", "Yes")
        c.event("EndDialog", "Return")

        #####################################################################
        # Global "Wait for costing" dialog
        costing = Dialog(db, "WaitForCostingDlg", 50, 10, 260, 85, modal, title,
                         "Return", "Return", "Return")
        costing.text("Text", 48, 15, 194, 30, 3,
                     "Please wait while the installer finishes determining your disk space requirements.")
        c = costing.pushbutton("Return", 102, 57, 56, 17, 3, "Return", None)
        c.event("EndDialog", "Exit")

        #####################################################################
        # Preparation dialog: no user input except cancellation
        prep = PyDialog(db, "PrepareDlg", x, y, w, h, modeless, title,
                        "Cancel", "Cancel", "Cancel")
        prep.text("Description", 15, 70, 320, 40, 0x30003,
                  "Please wait while the Installer prepares to guide you through the installation.")
        prep.title("Welcome to the [ProductName] Installer")
        c=prep.text("ActionText", 15, 110, 320, 20, 0x30003, "Pondering...")
        c.mapping("ActionText", "Text")
        c=prep.text("ActionData", 15, 135, 320, 30, 0x30003, None)
        c.mapping("ActionData", "Text")
        prep.back("Back", None, active=0)
        prep.next("Next", None, active=0)
        c=prep.cancel("Cancel", None)
        c.event("SpawnDialog", "CancelDlg")

        #####################################################################
        # Feature (Python directory) selection
        seldlg = PyDialog(db, "SelectFeaturesDlg", x, y, w, h, modal, title,
                        "Next", "Next", "Cancel")
        seldlg.title("Select Python Installations")

        seldlg.text("Hint", 15, 30, 300, 20, 3,
                    "Select the Python locations where %s should be installed."
                    % self.distribution.get_fullname())

        seldlg.back("< Back", None, active=0)
        c = seldlg.next("Next >", "Cancel")
        order = 1
        c.event("[TARGETDIR]", "[SourceDir]", ordering=order)
        for version in self.versions + [self.other_version]:
            order += 1
            c.event("[TARGETDIR]", "[TARGETDIR%s]" % version,
                    "FEATURE_SELECTED AND &Python%s=3" % version,
                    ordering=order)
        c.event("SpawnWaitDialog", "WaitForCostingDlg", ordering=order + 1)
        c.event("EndDialog", "Return", ordering=order + 2)
        c = seldlg.cancel("Cancel", "Features")
        c.event("SpawnDialog", "CancelDlg")

        c = seldlg.control("Features", "SelectionTree", 15, 60, 300, 120, 3,
                           "FEATURE", None, "PathEdit", None)
        c.event("[FEATURE_SELECTED]", "1")
        ver = self.other_version
        install_other_cond = "FEATURE_SELECTED AND &Python%s=3" % ver
        dont_install_other_cond = "FEATURE_SELECTED AND &Python%s<>3" % ver

        c = seldlg.text("Other", 15, 200, 300, 15, 3,
                        "Provide an alternate Python location")
        c.condition("Enable", install_other_cond)
        c.condition("Show", install_other_cond)
        c.condition("Disable", dont_install_other_cond)
        c.condition("Hide", dont_install_other_cond)

        c = seldlg.control("PathEdit", "PathEdit", 15, 215, 300, 16, 1,
                           "TARGETDIR" + ver, None, "Next", None)
        c.condition("Enable", install_other_cond)
        c.condition("Show", install_other_cond)
        c.condition("Disable", dont_install_other_cond)
        c.condition("Hide", dont_install_other_cond)

        #####################################################################
        # Disk cost
        cost = PyDialog(db, "DiskCostDlg", x, y, w, h, modal, title,
                        "OK", "OK", "OK", bitmap=False)
        cost.text("Title", 15, 6, 200, 15, 0x30003,
                 r"{\DlgFontBold8}Disk Space Requirements")
        cost.text("Description", 20, 20, 280, 20, 0x30003,
                  "The disk space required for the installation of the selected features.")
        cost.text("Text", 20, 53, 330, 60, 3,
                  "The highlighted volumes (if any) do not have enough disk space "
              "available for the currently selected features.  You can either "
              "remove some files from the highlighted volumes, or choose to "
              "install less features onto local drive(s), or select different "
              "destination drive(s).")
        cost.control("VolumeList", "VolumeCostList", 20, 100, 330, 150, 393223,
                     None, "{120}{70}{70}{70}{70}", None, None)
        cost.xbutton("OK", "Ok", None, 0.5).event("EndDialog", "Return")

        #####################################################################
        # WhichUsers Dialog. Only available on NT, and for privileged users.
        # This must be run before FindRelatedProducts, because that will
        # take into account whether the previous installation was per-user
        # or per-machine. We currently don't support going back to this
        # dialog after "Next" was selected; to support this, we would need to
        # find how to reset the ALLUSERS property, and how to re-run
        # FindRelatedProducts.
        # On Windows9x, the ALLUSERS property is ignored on the command line
        # and in the Property table, but installer fails according to the documentation
        # if a dialog attempts to set ALLUSERS.
        whichusers = PyDialog(db, "WhichUsersDlg", x, y, w, h, modal, title,
                            "AdminInstall", "Next", "Cancel")
        whichusers.title("Select whether to install [ProductName] for all users of this computer.")
        # A radio group with two options: allusers, justme
        g = whichusers.radiogroup("AdminInstall", 15, 60, 260, 50, 3,
                                  "WhichUsers", "", "Next")
        g.add("ALL", 0, 5, 150, 20, "Install for all users")
        g.add("JUSTME", 0, 25, 150, 20, "Install just for me")

        whichusers.back("Back", None, active=0)

        c = whichusers.next("Next >", "Cancel")
        c.event("[ALLUSERS]", "1", 'WhichUsers="ALL"', 1)
        c.event("EndDialog", "Return", ordering = 2)

        c = whichusers.cancel("Cancel", "AdminInstall")
        c.event("SpawnDialog", "CancelDlg")

        #####################################################################
        # Installation Progress dialog (modeless)
        progress = PyDialog(db, "ProgressDlg", x, y, w, h, modeless, title,
                            "Cancel", "Cancel", "Cancel", bitmap=False)
        progress.text("Title", 20, 15, 200, 15, 0x30003,
                     r"{\DlgFontBold8}[Progress1] [ProductName]")
        progress.text("Text", 35, 65, 300, 30, 3,
                      "Please wait while the Installer [Progress2] [ProductName]. "
                      "This may take several minutes.")
        progress.text("StatusLabel", 35, 100, 35, 20, 3, "Status:")

        c=progress.text("ActionText", 70, 100, w-70, 20, 3, "Pondering...")
        c.mapping("ActionText", "Text")

        #c=progress.text("ActionData", 35, 140, 300, 20, 3, None)
        #c.mapping("ActionData", "Text")

        c=progress.control("ProgressBar", "ProgressBar", 35, 120, 300, 10, 65537,
                           None, "Progress done", None, None)
        c.mapping("SetProgress", "Progress")

        progress.back("< Back", "Next", active=False)
        progress.next("Next >", "Cancel", active=False)
        progress.cancel("Cancel", "Back").event("SpawnDialog", "CancelDlg")

        ###################################################################
        # Maintenance type: repair/uninstall
        maint = PyDialog(db, "MaintenanceTypeDlg", x, y, w, h, modal, title,
                         "Next", "Next", "Cancel")
        maint.title("Welcome to the [ProductName] Setup Wizard")
        maint.text("BodyText", 15, 63, 330, 42, 3,
                   "Select whether you want to repair or remove [ProductName].")
        g=maint.radiogroup("RepairRadioGroup", 15, 108, 330, 60, 3,
                            "MaintenanceForm_Action", "", "Next")
        #g.add("Change", 0, 0, 200, 17, "&Change [ProductName]")
        g.add("Repair", 0, 18, 200, 17, "&Repair [ProductName]")
        g.add("Remove", 0, 36, 200, 17, "Re&move [ProductName]")

        maint.back("< Back", None, active=False)
        c=maint.next("Finish", "Cancel")
        # Change installation: Change progress dialog to "Change", then ask
        # for feature selection
        #c.event("[Progress1]", "Change", 'MaintenanceForm_Action="Change"', 1)
        #c.event("[Progress2]", "changes", 'MaintenanceForm_Action="Change"', 2)

        # Reinstall: Change progress dialog to "Repair", then invoke reinstall
        # Also set list of reinstalled features to "ALL"
        c.event("[REINSTALL]", "ALL", 'MaintenanceForm_Action="Repair"', 5)
        c.event("[Progress1]", "Repairing", 'MaintenanceForm_Action="Repair"', 6)
        c.event("[Progress2]", "repairs", 'MaintenanceForm_Action="Repair"', 7)
        c.event("Reinstall", "ALL", 'MaintenanceForm_Action="Repair"', 8)

        # Uninstall: Change progress to "Remove", then invoke uninstall
        # Also set list of removed features to "ALL"
        c.event("[REMOVE]", "ALL", 'MaintenanceForm_Action="Remove"', 11)
        c.event("[Progress1]", "Removing", 'MaintenanceForm_Action="Remove"', 12)
        c.event("[Progress2]", "removes", 'MaintenanceForm_Action="Remove"', 13)
        c.event("Remove", "ALL", 'MaintenanceForm_Action="Remove"', 14)

        # Close dialog when maintenance action scheduled
        c.event("EndDialog", "Return", 'MaintenanceForm_Action<>"Change"', 20)
        #c.event("NewDialog", "SelectFeaturesDlg", 'MaintenanceForm_Action="Change"', 21)

        maint.cancel("Cancel", "RepairRadioGroup").event("SpawnDialog", "CancelDlg")

    def get_installer_filename(self, fullname):
        # Factored out to allow overriding in subclasses
        if self.target_version:
            base_name = "%s.%s-py%s.msi" % (fullname, self.plat_name,
                                            self.target_version)
        else:
            base_name = "%s.%s.msi" % (fullname, self.plat_name)
        installer_name = os.path.join(self.dist_dir, base_name)
        return installer_name
install_scripts.py000064400000003741150513660020010336 0ustar00"""distutils.command.install_scripts

Implements the Distutils 'install_scripts' command, for installing
Python scripts."""

# contributed by Bastian Kleineidam

import os
from distutils.core import Command
from distutils import log
from stat import ST_MODE


class install_scripts(Command):

    description = "install scripts (Python or otherwise)"

    user_options = [
        ('install-dir=', 'd', "directory to install scripts to"),
        ('build-dir=','b', "build directory (where to install from)"),
        ('force', 'f', "force installation (overwrite existing files)"),
        ('skip-build', None, "skip the build steps"),
    ]

    boolean_options = ['force', 'skip-build']

    def initialize_options(self):
        self.install_dir = None
        self.force = 0
        self.build_dir = None
        self.skip_build = None

    def finalize_options(self):
        self.set_undefined_options('build', ('build_scripts', 'build_dir'))
        self.set_undefined_options('install',
                                   ('install_scripts', 'install_dir'),
                                   ('force', 'force'),
                                   ('skip_build', 'skip_build'),
                                  )

    def run(self):
        if not self.skip_build:
            self.run_command('build_scripts')
        self.outfiles = self.copy_tree(self.build_dir, self.install_dir)
        if os.name == 'posix':
            # Set the executable bits (owner, group, and world) on
            # all the scripts we just installed.
            for file in self.get_outputs():
                if self.dry_run:
                    log.info("changing mode of %s", file)
                else:
                    mode = ((os.stat(file)[ST_MODE]) | 0o555) & 0o7777
                    log.info("changing mode of %s to %o", file, mode)
                    os.chmod(file, mode)

    def get_inputs(self):
        return self.distribution.scripts or []

    def get_outputs(self):
        return self.outfiles or []
bdist_wininst.py000064400000037253150513660020010006 0ustar00"""distutils.command.bdist_wininst

Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program."""

import os
import sys
import warnings
from distutils.core import Command
from distutils.util import get_platform
from distutils.dir_util import create_tree, remove_tree
from distutils.errors import *
from distutils.sysconfig import get_python_version
from distutils import log

class bdist_wininst(Command):

    description = "create an executable installer for MS Windows"

    user_options = [('bdist-dir=', None,
                     "temporary directory for creating the distribution"),
                    ('plat-name=', 'p',
                     "platform name to embed in generated filenames "
                     "(default: %s)" % get_platform()),
                    ('keep-temp', 'k',
                     "keep the pseudo-installation tree around after " +
                     "creating the distribution archive"),
                    ('target-version=', None,
                     "require a specific python version" +
                     " on the target system"),
                    ('no-target-compile', 'c',
                     "do not compile .py to .pyc on the target system"),
                    ('no-target-optimize', 'o',
                     "do not compile .py to .pyo (optimized) "
                     "on the target system"),
                    ('dist-dir=', 'd',
                     "directory to put final built distributions in"),
                    ('bitmap=', 'b',
                     "bitmap to use for the installer instead of python-powered logo"),
                    ('title=', 't',
                     "title to display on the installer background instead of default"),
                    ('skip-build', None,
                     "skip rebuilding everything (for testing/debugging)"),
                    ('install-script=', None,
                     "basename of installation script to be run after "
                     "installation or before deinstallation"),
                    ('pre-install-script=', None,
                     "Fully qualified filename of a script to be run before "
                     "any files are installed.  This script need not be in the "
                     "distribution"),
                    ('user-access-control=', None,
                     "specify Vista's UAC handling - 'none'/default=no "
                     "handling, 'auto'=use UAC if target Python installed for "
                     "all users, 'force'=always use UAC"),
                   ]

    boolean_options = ['keep-temp', 'no-target-compile', 'no-target-optimize',
                       'skip-build']

    # bpo-10945: bdist_wininst requires mbcs encoding only available on Windows
    _unsupported = (sys.platform != "win32")

    def __init__(self, *args, **kw):
        super().__init__(*args, **kw)
        warnings.warn("bdist_wininst command is deprecated since Python 3.8, "
                      "use bdist_wheel (wheel packages) instead",
                      DeprecationWarning, 2)

    def initialize_options(self):
        self.bdist_dir = None
        self.plat_name = None
        self.keep_temp = 0
        self.no_target_compile = 0
        self.no_target_optimize = 0
        self.target_version = None
        self.dist_dir = None
        self.bitmap = None
        self.title = None
        self.skip_build = None
        self.install_script = None
        self.pre_install_script = None
        self.user_access_control = None


    def finalize_options(self):
        self.set_undefined_options('bdist', ('skip_build', 'skip_build'))

        if self.bdist_dir is None:
            if self.skip_build and self.plat_name:
                # If build is skipped and plat_name is overridden, bdist will
                # not see the correct 'plat_name' - so set that up manually.
                bdist = self.distribution.get_command_obj('bdist')
                bdist.plat_name = self.plat_name
                # next the command will be initialized using that name
            bdist_base = self.get_finalized_command('bdist').bdist_base
            self.bdist_dir = os.path.join(bdist_base, 'wininst')

        if not self.target_version:
            self.target_version = ""

        if not self.skip_build and self.distribution.has_ext_modules():
            short_version = get_python_version()
            if self.target_version and self.target_version != short_version:
                raise DistutilsOptionError(
                      "target version can only be %s, or the '--skip-build'" \
                      " option must be specified" % (short_version,))
            self.target_version = short_version

        self.set_undefined_options('bdist',
                                   ('dist_dir', 'dist_dir'),
                                   ('plat_name', 'plat_name'),
                                  )

        if self.install_script:
            for script in self.distribution.scripts:
                if self.install_script == os.path.basename(script):
                    break
            else:
                raise DistutilsOptionError(
                      "install_script '%s' not found in scripts"
                      % self.install_script)

    def run(self):
        if (sys.platform != "win32" and
            (self.distribution.has_ext_modules() or
             self.distribution.has_c_libraries())):
            raise DistutilsPlatformError \
                  ("distribution contains extensions and/or C libraries; "
                   "must be compiled on a Windows 32 platform")

        if not self.skip_build:
            self.run_command('build')

        install = self.reinitialize_command('install', reinit_subcommands=1)
        install.root = self.bdist_dir
        install.skip_build = self.skip_build
        install.warn_dir = 0
        install.plat_name = self.plat_name

        install_lib = self.reinitialize_command('install_lib')
        # we do not want to include pyc or pyo files
        install_lib.compile = 0
        install_lib.optimize = 0

        if self.distribution.has_ext_modules():
            # If we are building an installer for a Python version other
            # than the one we are currently running, then we need to ensure
            # our build_lib reflects the other Python version rather than ours.
            # Note that for target_version!=sys.version, we must have skipped the
            # build step, so there is no issue with enforcing the build of this
            # version.
            target_version = self.target_version
            if not target_version:
                assert self.skip_build, "Should have already checked this"
                target_version = '%d.%d' % sys.version_info[:2]
            plat_specifier = ".%s-%s" % (self.plat_name, target_version)
            build = self.get_finalized_command('build')
            build.build_lib = os.path.join(build.build_base,
                                           'lib' + plat_specifier)

        # Use a custom scheme for the zip-file, because we have to decide
        # at installation time which scheme to use.
        for key in ('purelib', 'platlib', 'headers', 'scripts', 'data'):
            value = key.upper()
            if key == 'headers':
                value = value + '/Include/$dist_name'
            setattr(install,
                    'install_' + key,
                    value)

        log.info("installing to %s", self.bdist_dir)
        install.ensure_finalized()

        # avoid warning of 'install_lib' about installing
        # into a directory not in sys.path
        sys.path.insert(0, os.path.join(self.bdist_dir, 'PURELIB'))

        install.run()

        del sys.path[0]

        # And make an archive relative to the root of the
        # pseudo-installation tree.
        from tempfile import mktemp
        archive_basename = mktemp()
        fullname = self.distribution.get_fullname()
        arcname = self.make_archive(archive_basename, "zip",
                                    root_dir=self.bdist_dir)
        # create an exe containing the zip-file
        self.create_exe(arcname, fullname, self.bitmap)
        if self.distribution.has_ext_modules():
            pyversion = get_python_version()
        else:
            pyversion = 'any'
        self.distribution.dist_files.append(('bdist_wininst', pyversion,
                                             self.get_installer_filename(fullname)))
        # remove the zip-file again
        log.debug("removing temporary file '%s'", arcname)
        os.remove(arcname)

        if not self.keep_temp:
            remove_tree(self.bdist_dir, dry_run=self.dry_run)

    def get_inidata(self):
        # Return data describing the installation.
        lines = []
        metadata = self.distribution.metadata

        # Write the [metadata] section.
        lines.append("[metadata]")

        # 'info' will be displayed in the installer's dialog box,
        # describing the items to be installed.
        info = (metadata.long_description or '') + '\n'

        # Escape newline characters
        def escape(s):
            return s.replace("\n", "\\n")

        for name in ["author", "author_email", "description", "maintainer",
                     "maintainer_email", "name", "url", "version"]:
            data = getattr(metadata, name, "")
            if data:
                info = info + ("\n    %s: %s" % \
                               (name.capitalize(), escape(data)))
                lines.append("%s=%s" % (name, escape(data)))

        # The [setup] section contains entries controlling
        # the installer runtime.
        lines.append("\n[Setup]")
        if self.install_script:
            lines.append("install_script=%s" % self.install_script)
        lines.append("info=%s" % escape(info))
        lines.append("target_compile=%d" % (not self.no_target_compile))
        lines.append("target_optimize=%d" % (not self.no_target_optimize))
        if self.target_version:
            lines.append("target_version=%s" % self.target_version)
        if self.user_access_control:
            lines.append("user_access_control=%s" % self.user_access_control)

        title = self.title or self.distribution.get_fullname()
        lines.append("title=%s" % escape(title))
        import time
        import distutils
        build_info = "Built %s with distutils-%s" % \
                     (time.ctime(time.time()), distutils.__version__)
        lines.append("build_info=%s" % build_info)
        return "\n".join(lines)

    def create_exe(self, arcname, fullname, bitmap=None):
        import struct

        self.mkpath(self.dist_dir)

        cfgdata = self.get_inidata()

        installer_name = self.get_installer_filename(fullname)
        self.announce("creating %s" % installer_name)

        if bitmap:
            with open(bitmap, "rb") as f:
                bitmapdata = f.read()
            bitmaplen = len(bitmapdata)
        else:
            bitmaplen = 0

        with open(installer_name, "wb") as file:
            file.write(self.get_exe_bytes())
            if bitmap:
                file.write(bitmapdata)

            # Convert cfgdata from unicode to ascii, mbcs encoded
            if isinstance(cfgdata, str):
                cfgdata = cfgdata.encode("mbcs")

            # Append the pre-install script
            cfgdata = cfgdata + b"\0"
            if self.pre_install_script:
                # We need to normalize newlines, so we open in text mode and
                # convert back to bytes. "latin-1" simply avoids any possible
                # failures.
                with open(self.pre_install_script, "r",
                          encoding="latin-1") as script:
                    script_data = script.read().encode("latin-1")
                cfgdata = cfgdata + script_data + b"\n\0"
            else:
                # empty pre-install script
                cfgdata = cfgdata + b"\0"
            file.write(cfgdata)

            # The 'magic number' 0x1234567B is used to make sure that the
            # binary layout of 'cfgdata' is what the wininst.exe binary
            # expects.  If the layout changes, increment that number, make
            # the corresponding changes to the wininst.exe sources, and
            # recompile them.
            header = struct.pack("<iii",
                                0x1234567B,       # tag
                                len(cfgdata),     # length
                                bitmaplen,        # number of bytes in bitmap
                                )
            file.write(header)
            with open(arcname, "rb") as f:
                file.write(f.read())

    def get_installer_filename(self, fullname):
        # Factored out to allow overriding in subclasses
        if self.target_version:
            # if we create an installer for a specific python version,
            # it's better to include this in the name
            installer_name = os.path.join(self.dist_dir,
                                          "%s.%s-py%s.exe" %
                                           (fullname, self.plat_name, self.target_version))
        else:
            installer_name = os.path.join(self.dist_dir,
                                          "%s.%s.exe" % (fullname, self.plat_name))
        return installer_name

    def get_exe_bytes(self):
        # If a target-version other than the current version has been
        # specified, then using the MSVC version from *this* build is no good.
        # Without actually finding and executing the target version and parsing
        # its sys.version, we just hard-code our knowledge of old versions.
        # NOTE: Possible alternative is to allow "--target-version" to
        # specify a Python executable rather than a simple version string.
        # We can then execute this program to obtain any info we need, such
        # as the real sys.version string for the build.
        cur_version = get_python_version()

        # If the target version is *later* than us, then we assume they
        # use what we use
        # string compares seem wrong, but are what sysconfig.py itself uses
        if self.target_version and self.target_version < cur_version:
            if self.target_version < "2.4":
                bv = '6.0'
            elif self.target_version == "2.4":
                bv = '7.1'
            elif self.target_version == "2.5":
                bv = '8.0'
            elif self.target_version <= "3.2":
                bv = '9.0'
            elif self.target_version <= "3.4":
                bv = '10.0'
            else:
                bv = '14.0'
        else:
            # for current version - use authoritative check.
            try:
                from msvcrt import CRT_ASSEMBLY_VERSION
            except ImportError:
                # cross-building, so assume the latest version
                bv = '14.0'
            else:
                # as far as we know, CRT is binary compatible based on
                # the first field, so assume 'x.0' until proven otherwise
                major = CRT_ASSEMBLY_VERSION.partition('.')[0]
                bv = major + '.0'


        # wininst-x.y.exe is in the same directory as this file
        directory = os.path.dirname(__file__)
        # we must use a wininst-x.y.exe built with the same C compiler
        # used for python.  XXX What about mingw, borland, and so on?

        # if plat_name starts with "win" but is not "win32"
        # we want to strip "win" and leave the rest (e.g. -amd64)
        # for all other cases, we don't want any suffix
        if self.plat_name != 'win32' and self.plat_name[:3] == 'win':
            sfix = self.plat_name[3:]
        else:
            sfix = ''

        filename = os.path.join(directory, "wininst-%s%s.exe" % (bv, sfix))
        f = open(filename, "rb")
        try:
            return f.read()
        finally:
            f.close()
upload.py000064400000016364150513660020006412 0ustar00"""
distutils.command.upload

Implements the Distutils 'upload' subcommand (upload package to a package
index).
"""

import os
import io
import platform
import hashlib
from base64 import standard_b64encode
from urllib.request import urlopen, Request, HTTPError
from urllib.parse import urlparse
from distutils.errors import DistutilsError, DistutilsOptionError
from distutils.core import PyPIRCCommand
from distutils.spawn import spawn
from distutils import log

class upload(PyPIRCCommand):

    description = "upload binary package to PyPI"

    user_options = PyPIRCCommand.user_options + [
        ('sign', 's',
         'sign files to upload using gpg'),
        ('identity=', 'i', 'GPG identity used to sign files'),
        ]

    boolean_options = PyPIRCCommand.boolean_options + ['sign']

    def initialize_options(self):
        PyPIRCCommand.initialize_options(self)
        self.username = ''
        self.password = ''
        self.show_response = 0
        self.sign = False
        self.identity = None

    def finalize_options(self):
        PyPIRCCommand.finalize_options(self)
        if self.identity and not self.sign:
            raise DistutilsOptionError(
                "Must use --sign for --identity to have meaning"
            )
        config = self._read_pypirc()
        if config != {}:
            self.username = config['username']
            self.password = config['password']
            self.repository = config['repository']
            self.realm = config['realm']

        # getting the password from the distribution
        # if previously set by the register command
        if not self.password and self.distribution.password:
            self.password = self.distribution.password

    def run(self):
        if not self.distribution.dist_files:
            msg = ("Must create and upload files in one command "
                   "(e.g. setup.py sdist upload)")
            raise DistutilsOptionError(msg)
        for command, pyversion, filename in self.distribution.dist_files:
            self.upload_file(command, pyversion, filename)

    def upload_file(self, command, pyversion, filename):
        # Makes sure the repository URL is compliant
        schema, netloc, url, params, query, fragments = \
            urlparse(self.repository)
        if params or query or fragments:
            raise AssertionError("Incompatible url %s" % self.repository)

        if schema not in ('http', 'https'):
            raise AssertionError("unsupported schema " + schema)

        # Sign if requested
        if self.sign:
            gpg_args = ["gpg", "--detach-sign", "-a", filename]
            if self.identity:
                gpg_args[2:2] = ["--local-user", self.identity]
            spawn(gpg_args,
                  dry_run=self.dry_run)

        # Fill in the data - send all the meta-data in case we need to
        # register a new release
        f = open(filename,'rb')
        try:
            content = f.read()
        finally:
            f.close()
        meta = self.distribution.metadata
        data = {
            # action
            ':action': 'file_upload',
            'protocol_version': '1',

            # identify release
            'name': meta.get_name(),
            'version': meta.get_version(),

            # file content
            'content': (os.path.basename(filename),content),
            'filetype': command,
            'pyversion': pyversion,
            'sha256_digest': hashlib.sha256(content).hexdigest(),

            # additional meta-data
            'metadata_version': '1.0',
            'summary': meta.get_description(),
            'home_page': meta.get_url(),
            'author': meta.get_contact(),
            'author_email': meta.get_contact_email(),
            'license': meta.get_licence(),
            'description': meta.get_long_description(),
            'keywords': meta.get_keywords(),
            'platform': meta.get_platforms(),
            'classifiers': meta.get_classifiers(),
            'download_url': meta.get_download_url(),
            # PEP 314
            'provides': meta.get_provides(),
            'requires': meta.get_requires(),
            'obsoletes': meta.get_obsoletes(),
            }

        try:
            digest = hashlib.md5(content).hexdigest()
        except ValueError as e:
            msg = 'calculating md5 checksum failed: %s' % e
            self.announce(msg, log.INFO)
            from _hashlib import get_fips_mode
            if not get_fips_mode():
                # this really shouldn't fail
                raise
        else:
            data['md5_digest'] = digest

        data['comment'] = ''

        if self.sign:
            with open(filename + ".asc", "rb") as f:
                data['gpg_signature'] = (os.path.basename(filename) + ".asc",
                                         f.read())

        # set up the authentication
        user_pass = (self.username + ":" + self.password).encode('ascii')
        # The exact encoding of the authentication string is debated.
        # Anyway PyPI only accepts ascii for both username or password.
        auth = "Basic " + standard_b64encode(user_pass).decode('ascii')

        # Build up the MIME payload for the POST data
        boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
        sep_boundary = b'\r\n--' + boundary.encode('ascii')
        end_boundary = sep_boundary + b'--\r\n'
        body = io.BytesIO()
        for key, value in data.items():
            title = '\r\nContent-Disposition: form-data; name="%s"' % key
            # handle multiple entries for the same name
            if not isinstance(value, list):
                value = [value]
            for value in value:
                if type(value) is tuple:
                    title += '; filename="%s"' % value[0]
                    value = value[1]
                else:
                    value = str(value).encode('utf-8')
                body.write(sep_boundary)
                body.write(title.encode('utf-8'))
                body.write(b"\r\n\r\n")
                body.write(value)
        body.write(end_boundary)
        body = body.getvalue()

        msg = "Submitting %s to %s" % (filename, self.repository)
        self.announce(msg, log.INFO)

        # build the Request
        headers = {
            'Content-type': 'multipart/form-data; boundary=%s' % boundary,
            'Content-length': str(len(body)),
            'Authorization': auth,
        }

        request = Request(self.repository, data=body,
                          headers=headers)
        # send the data
        try:
            result = urlopen(request)
            status = result.getcode()
            reason = result.msg
        except HTTPError as e:
            status = e.code
            reason = e.msg
        except OSError as e:
            self.announce(str(e), log.ERROR)
            raise

        if status == 200:
            self.announce('Server response (%s): %s' % (status, reason),
                          log.INFO)
            if self.show_response:
                text = self._read_pypi_response(result)
                msg = '\n'.join(('-' * 75, text, '-' * 75))
                self.announce(msg, log.INFO)
        else:
            msg = 'Upload failed (%s): %s' % (status, reason)
            self.announce(msg, log.ERROR)
            raise DistutilsError(msg)
bdist_rpm.py000064400000052111150513660020007077 0ustar00"""distutils.command.bdist_rpm

Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions)."""

import subprocess, sys, os
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.util import get_platform
from distutils.file_util import write_file
from distutils.errors import *
from distutils.sysconfig import get_python_version
from distutils import log

class bdist_rpm(Command):

    description = "create an RPM distribution"

    user_options = [
        ('bdist-base=', None,
         "base directory for creating built distributions"),
        ('rpm-base=', None,
         "base directory for creating RPMs (defaults to \"rpm\" under "
         "--bdist-base; must be specified for RPM 2)"),
        ('dist-dir=', 'd',
         "directory to put final RPM files in "
         "(and .spec files if --spec-only)"),
        ('python=', None,
         "path to Python interpreter to hard-code in the .spec file "
         "(default: \"python\")"),
        ('fix-python', None,
         "hard-code the exact path to the current Python interpreter in "
         "the .spec file"),
        ('spec-only', None,
         "only regenerate spec file"),
        ('source-only', None,
         "only generate source RPM"),
        ('binary-only', None,
         "only generate binary RPM"),
        ('use-bzip2', None,
         "use bzip2 instead of gzip to create source distribution"),

        # More meta-data: too RPM-specific to put in the setup script,
        # but needs to go in the .spec file -- so we make these options
        # to "bdist_rpm".  The idea is that packagers would put this
        # info in setup.cfg, although they are of course free to
        # supply it on the command line.
        ('distribution-name=', None,
         "name of the (Linux) distribution to which this "
         "RPM applies (*not* the name of the module distribution!)"),
        ('group=', None,
         "package classification [default: \"Development/Libraries\"]"),
        ('release=', None,
         "RPM release number"),
        ('serial=', None,
         "RPM serial number"),
        ('vendor=', None,
         "RPM \"vendor\" (eg. \"Joe Blow <joe@example.com>\") "
         "[default: maintainer or author from setup script]"),
        ('packager=', None,
         "RPM packager (eg. \"Jane Doe <jane@example.net>\") "
         "[default: vendor]"),
        ('doc-files=', None,
         "list of documentation files (space or comma-separated)"),
        ('changelog=', None,
         "RPM changelog"),
        ('icon=', None,
         "name of icon file"),
        ('provides=', None,
         "capabilities provided by this package"),
        ('requires=', None,
         "capabilities required by this package"),
        ('conflicts=', None,
         "capabilities which conflict with this package"),
        ('build-requires=', None,
         "capabilities required to build this package"),
        ('obsoletes=', None,
         "capabilities made obsolete by this package"),
        ('no-autoreq', None,
         "do not automatically calculate dependencies"),

        # Actions to take when building RPM
        ('keep-temp', 'k',
         "don't clean up RPM build directory"),
        ('no-keep-temp', None,
         "clean up RPM build directory [default]"),
        ('use-rpm-opt-flags', None,
         "compile with RPM_OPT_FLAGS when building from source RPM"),
        ('no-rpm-opt-flags', None,
         "do not pass any RPM CFLAGS to compiler"),
        ('rpm3-mode', None,
         "RPM 3 compatibility mode (default)"),
        ('rpm2-mode', None,
         "RPM 2 compatibility mode"),

        # Add the hooks necessary for specifying custom scripts
        ('prep-script=', None,
         "Specify a script for the PREP phase of RPM building"),
        ('build-script=', None,
         "Specify a script for the BUILD phase of RPM building"),

        ('pre-install=', None,
         "Specify a script for the pre-INSTALL phase of RPM building"),
        ('install-script=', None,
         "Specify a script for the INSTALL phase of RPM building"),
        ('post-install=', None,
         "Specify a script for the post-INSTALL phase of RPM building"),

        ('pre-uninstall=', None,
         "Specify a script for the pre-UNINSTALL phase of RPM building"),
        ('post-uninstall=', None,
         "Specify a script for the post-UNINSTALL phase of RPM building"),

        ('clean-script=', None,
         "Specify a script for the CLEAN phase of RPM building"),

        ('verify-script=', None,
         "Specify a script for the VERIFY phase of the RPM build"),

        # Allow a packager to explicitly force an architecture
        ('force-arch=', None,
         "Force an architecture onto the RPM build process"),

        ('quiet', 'q',
         "Run the INSTALL phase of RPM building in quiet mode"),
        ]

    boolean_options = ['keep-temp', 'use-rpm-opt-flags', 'rpm3-mode',
                       'no-autoreq', 'quiet']

    negative_opt = {'no-keep-temp': 'keep-temp',
                    'no-rpm-opt-flags': 'use-rpm-opt-flags',
                    'rpm2-mode': 'rpm3-mode'}


    def initialize_options(self):
        self.bdist_base = None
        self.rpm_base = None
        self.dist_dir = None
        self.python = None
        self.fix_python = None
        self.spec_only = None
        self.binary_only = None
        self.source_only = None
        self.use_bzip2 = None

        self.distribution_name = None
        self.group = None
        self.release = None
        self.serial = None
        self.vendor = None
        self.packager = None
        self.doc_files = None
        self.changelog = None
        self.icon = None

        self.prep_script = None
        self.build_script = None
        self.install_script = None
        self.clean_script = None
        self.verify_script = None
        self.pre_install = None
        self.post_install = None
        self.pre_uninstall = None
        self.post_uninstall = None
        self.prep = None
        self.provides = None
        self.requires = None
        self.conflicts = None
        self.build_requires = None
        self.obsoletes = None

        self.keep_temp = 0
        self.use_rpm_opt_flags = 1
        self.rpm3_mode = 1
        self.no_autoreq = 0

        self.force_arch = None
        self.quiet = 0

    def finalize_options(self):
        self.set_undefined_options('bdist', ('bdist_base', 'bdist_base'))
        if self.rpm_base is None:
            if not self.rpm3_mode:
                raise DistutilsOptionError(
                      "you must specify --rpm-base in RPM 2 mode")
            self.rpm_base = os.path.join(self.bdist_base, "rpm")

        if self.python is None:
            if self.fix_python:
                self.python = sys.executable
            else:
                self.python = "python3"
        elif self.fix_python:
            raise DistutilsOptionError(
                  "--python and --fix-python are mutually exclusive options")

        if os.name != 'posix':
            raise DistutilsPlatformError("don't know how to create RPM "
                   "distributions on platform %s" % os.name)
        if self.binary_only and self.source_only:
            raise DistutilsOptionError(
                  "cannot supply both '--source-only' and '--binary-only'")

        # don't pass CFLAGS to pure python distributions
        if not self.distribution.has_ext_modules():
            self.use_rpm_opt_flags = 0

        self.set_undefined_options('bdist', ('dist_dir', 'dist_dir'))
        self.finalize_package_data()

    def finalize_package_data(self):
        self.ensure_string('group', "Development/Libraries")
        self.ensure_string('vendor',
                           "%s <%s>" % (self.distribution.get_contact(),
                                        self.distribution.get_contact_email()))
        self.ensure_string('packager')
        self.ensure_string_list('doc_files')
        if isinstance(self.doc_files, list):
            for readme in ('README', 'README.txt'):
                if os.path.exists(readme) and readme not in self.doc_files:
                    self.doc_files.append(readme)

        self.ensure_string('release', "1")
        self.ensure_string('serial')   # should it be an int?

        self.ensure_string('distribution_name')

        self.ensure_string('changelog')
          # Format changelog correctly
        self.changelog = self._format_changelog(self.changelog)

        self.ensure_filename('icon')

        self.ensure_filename('prep_script')
        self.ensure_filename('build_script')
        self.ensure_filename('install_script')
        self.ensure_filename('clean_script')
        self.ensure_filename('verify_script')
        self.ensure_filename('pre_install')
        self.ensure_filename('post_install')
        self.ensure_filename('pre_uninstall')
        self.ensure_filename('post_uninstall')

        # XXX don't forget we punted on summaries and descriptions -- they
        # should be handled here eventually!

        # Now *this* is some meta-data that belongs in the setup script...
        self.ensure_string_list('provides')
        self.ensure_string_list('requires')
        self.ensure_string_list('conflicts')
        self.ensure_string_list('build_requires')
        self.ensure_string_list('obsoletes')

        self.ensure_string('force_arch')

    def run(self):
        if DEBUG:
            print("before _get_package_data():")
            print("vendor =", self.vendor)
            print("packager =", self.packager)
            print("doc_files =", self.doc_files)
            print("changelog =", self.changelog)

        # make directories
        if self.spec_only:
            spec_dir = self.dist_dir
            self.mkpath(spec_dir)
        else:
            rpm_dir = {}
            for d in ('SOURCES', 'SPECS', 'BUILD', 'RPMS', 'SRPMS'):
                rpm_dir[d] = os.path.join(self.rpm_base, d)
                self.mkpath(rpm_dir[d])
            spec_dir = rpm_dir['SPECS']

        # Spec file goes into 'dist_dir' if '--spec-only specified',
        # build/rpm.<plat> otherwise.
        spec_path = os.path.join(spec_dir,
                                 "%s.spec" % self.distribution.get_name())
        self.execute(write_file,
                     (spec_path,
                      self._make_spec_file()),
                     "writing '%s'" % spec_path)

        if self.spec_only: # stop if requested
            return

        # Make a source distribution and copy to SOURCES directory with
        # optional icon.
        saved_dist_files = self.distribution.dist_files[:]
        sdist = self.reinitialize_command('sdist')
        if self.use_bzip2:
            sdist.formats = ['bztar']
        else:
            sdist.formats = ['gztar']
        self.run_command('sdist')
        self.distribution.dist_files = saved_dist_files

        source = sdist.get_archive_files()[0]
        source_dir = rpm_dir['SOURCES']
        self.copy_file(source, source_dir)

        if self.icon:
            if os.path.exists(self.icon):
                self.copy_file(self.icon, source_dir)
            else:
                raise DistutilsFileError(
                      "icon file '%s' does not exist" % self.icon)

        # build package
        log.info("building RPMs")
        rpm_cmd = ['rpmbuild']

        if self.source_only: # what kind of RPMs?
            rpm_cmd.append('-bs')
        elif self.binary_only:
            rpm_cmd.append('-bb')
        else:
            rpm_cmd.append('-ba')
        rpm_cmd.extend(['--define', '__python %s' % self.python])
        if self.rpm3_mode:
            rpm_cmd.extend(['--define',
                             '_topdir %s' % os.path.abspath(self.rpm_base)])
        if not self.keep_temp:
            rpm_cmd.append('--clean')

        if self.quiet:
            rpm_cmd.append('--quiet')

        rpm_cmd.append(spec_path)
        # Determine the binary rpm names that should be built out of this spec
        # file
        # Note that some of these may not be really built (if the file
        # list is empty)
        nvr_string = "%{name}-%{version}-%{release}"
        src_rpm = nvr_string + ".src.rpm"
        non_src_rpm = "%{arch}/" + nvr_string + ".%{arch}.rpm"
        q_cmd = r"rpm -q --qf '%s %s\n' --specfile '%s'" % (
            src_rpm, non_src_rpm, spec_path)

        out = os.popen(q_cmd)
        try:
            binary_rpms = []
            source_rpm = None
            while True:
                line = out.readline()
                if not line:
                    break
                l = line.strip().split()
                assert(len(l) == 2)
                binary_rpms.append(l[1])
                # The source rpm is named after the first entry in the spec file
                if source_rpm is None:
                    source_rpm = l[0]

            status = out.close()
            if status:
                raise DistutilsExecError("Failed to execute: %s" % repr(q_cmd))

        finally:
            out.close()

        self.spawn(rpm_cmd)

        if not self.dry_run:
            if self.distribution.has_ext_modules():
                pyversion = get_python_version()
            else:
                pyversion = 'any'

            if not self.binary_only:
                srpm = os.path.join(rpm_dir['SRPMS'], source_rpm)
                assert(os.path.exists(srpm))
                self.move_file(srpm, self.dist_dir)
                filename = os.path.join(self.dist_dir, source_rpm)
                self.distribution.dist_files.append(
                    ('bdist_rpm', pyversion, filename))

            if not self.source_only:
                for rpm in binary_rpms:
                    rpm = os.path.join(rpm_dir['RPMS'], rpm)
                    if os.path.exists(rpm):
                        self.move_file(rpm, self.dist_dir)
                        filename = os.path.join(self.dist_dir,
                                                os.path.basename(rpm))
                        self.distribution.dist_files.append(
                            ('bdist_rpm', pyversion, filename))

    def _dist_path(self, path):
        return os.path.join(self.dist_dir, os.path.basename(path))

    def _make_spec_file(self):
        """Generate the text of an RPM spec file and return it as a
        list of strings (one per line).
        """
        # definitions and headers
        spec_file = [
            '%define name ' + self.distribution.get_name(),
            '%define version ' + self.distribution.get_version().replace('-','_'),
            '%define unmangled_version ' + self.distribution.get_version(),
            '%define release ' + self.release.replace('-','_'),
            '',
            'Summary: ' + self.distribution.get_description(),
            ]

        # Workaround for #14443 which affects some RPM based systems such as
        # RHEL6 (and probably derivatives)
        vendor_hook = subprocess.getoutput('rpm --eval %{__os_install_post}')
        # Generate a potential replacement value for __os_install_post (whilst
        # normalizing the whitespace to simplify the test for whether the
        # invocation of brp-python-bytecompile passes in __python):
        vendor_hook = '\n'.join(['  %s \\' % line.strip()
                                 for line in vendor_hook.splitlines()])
        problem = "brp-python-bytecompile \\\n"
        fixed = "brp-python-bytecompile %{__python} \\\n"
        fixed_hook = vendor_hook.replace(problem, fixed)
        if fixed_hook != vendor_hook:
            spec_file.append('# Workaround for http://bugs.python.org/issue14443')
            spec_file.append('%define __os_install_post ' + fixed_hook + '\n')

        # put locale summaries into spec file
        # XXX not supported for now (hard to put a dictionary
        # in a config file -- arg!)
        #for locale in self.summaries.keys():
        #    spec_file.append('Summary(%s): %s' % (locale,
        #                                          self.summaries[locale]))

        spec_file.extend([
            'Name: %{name}',
            'Version: %{version}',
            'Release: %{release}',])

        # XXX yuck! this filename is available from the "sdist" command,
        # but only after it has run: and we create the spec file before
        # running "sdist", in case of --spec-only.
        if self.use_bzip2:
            spec_file.append('Source0: %{name}-%{unmangled_version}.tar.bz2')
        else:
            spec_file.append('Source0: %{name}-%{unmangled_version}.tar.gz')

        spec_file.extend([
            'License: ' + self.distribution.get_license(),
            'Group: ' + self.group,
            'BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot',
            'Prefix: %{_prefix}', ])

        if not self.force_arch:
            # noarch if no extension modules
            if not self.distribution.has_ext_modules():
                spec_file.append('BuildArch: noarch')
        else:
            spec_file.append( 'BuildArch: %s' % self.force_arch )

        for field in ('Vendor',
                      'Packager',
                      'Provides',
                      'Requires',
                      'Conflicts',
                      'Obsoletes',
                      ):
            val = getattr(self, field.lower())
            if isinstance(val, list):
                spec_file.append('%s: %s' % (field, ' '.join(val)))
            elif val is not None:
                spec_file.append('%s: %s' % (field, val))


        if self.distribution.get_url() != 'UNKNOWN':
            spec_file.append('Url: ' + self.distribution.get_url())

        if self.distribution_name:
            spec_file.append('Distribution: ' + self.distribution_name)

        if self.build_requires:
            spec_file.append('BuildRequires: ' +
                             ' '.join(self.build_requires))

        if self.icon:
            spec_file.append('Icon: ' + os.path.basename(self.icon))

        if self.no_autoreq:
            spec_file.append('AutoReq: 0')

        spec_file.extend([
            '',
            '%description',
            self.distribution.get_long_description()
            ])

        # put locale descriptions into spec file
        # XXX again, suppressed because config file syntax doesn't
        # easily support this ;-(
        #for locale in self.descriptions.keys():
        #    spec_file.extend([
        #        '',
        #        '%description -l ' + locale,
        #        self.descriptions[locale],
        #        ])

        # rpm scripts
        # figure out default build script
        def_setup_call = "%s %s" % (self.python,os.path.basename(sys.argv[0]))
        def_build = "%s build" % def_setup_call
        if self.use_rpm_opt_flags:
            def_build = 'env CFLAGS="$RPM_OPT_FLAGS" ' + def_build

        # insert contents of files

        # XXX this is kind of misleading: user-supplied options are files
        # that we open and interpolate into the spec file, but the defaults
        # are just text that we drop in as-is.  Hmmm.

        install_cmd = ('%s install -O1 --root=$RPM_BUILD_ROOT '
                       '--record=INSTALLED_FILES') % def_setup_call

        script_options = [
            ('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"),
            ('build', 'build_script', def_build),
            ('install', 'install_script', install_cmd),
            ('clean', 'clean_script', "rm -rf $RPM_BUILD_ROOT"),
            ('verifyscript', 'verify_script', None),
            ('pre', 'pre_install', None),
            ('post', 'post_install', None),
            ('preun', 'pre_uninstall', None),
            ('postun', 'post_uninstall', None),
        ]

        for (rpm_opt, attr, default) in script_options:
            # Insert contents of file referred to, if no file is referred to
            # use 'default' as contents of script
            val = getattr(self, attr)
            if val or default:
                spec_file.extend([
                    '',
                    '%' + rpm_opt,])
                if val:
                    with open(val) as f:
                        spec_file.extend(f.read().split('\n'))
                else:
                    spec_file.append(default)


        # files section
        spec_file.extend([
            '',
            '%files -f INSTALLED_FILES',
            '%defattr(-,root,root)',
            ])

        if self.doc_files:
            spec_file.append('%doc ' + ' '.join(self.doc_files))

        if self.changelog:
            spec_file.extend([
                '',
                '%changelog',])
            spec_file.extend(self.changelog)

        return spec_file

    def _format_changelog(self, changelog):
        """Format the changelog correctly and convert it to a list of strings
        """
        if not changelog:
            return changelog
        new_changelog = []
        for line in changelog.strip().split('\n'):
            line = line.strip()
            if line[0] == '*':
                new_changelog.extend(['', line])
            elif line[0] == '-':
                new_changelog.append(line)
            else:
                new_changelog.append('  ' + line)

        # strip trailing newline inserted by first changelog entry
        if not new_changelog[0]:
            del new_changelog[0]

        return new_changelog
__pycache__/install_egg_info.cpython-38.opt-2.pyc000064400000004417150513660020015653 0ustar00U

e5d+
�@s`ddlmZddlmZmZddlZddlZddlZGdd�de�Zdd�Z	dd	�Z
d
d�ZdS)�)�Command)�log�dir_utilNc@s6eZdZdZdgZdd�Zdd�Zdd�Zd	d
�ZdS)�install_egg_infoz8Install package's PKG-INFO metadata as an .egg-info file)zinstall-dir=�dzdirectory to install tocCs
d|_dS�N)�install_dir��self�r�:/usr/lib64/python3.8/distutils/command/install_egg_info.py�initialize_optionssz#install_egg_info.initialize_optionscCsb|�dd�dtt|j����tt|j����ftjdd��}t	j
�|j|�|_
|j
g|_dS)NZinstall_lib)rrz%s-%s-py%d.%d.egg-info�)Zset_undefined_options�to_filename�	safe_name�distributionZget_name�safe_versionZget_version�sys�version_info�os�path�joinr�target�outputs)r
�basenamerrr�finalize_optionss��z!install_egg_info.finalize_optionsc	Cs�|j}tj�|�r0tj�|�s0tj||jd�nNtj�|�rV|�	tj
|jfd|�n(tj�|j�s~|�	tj|jfd|j�t
�d|�|js�t|ddd��}|jj�|�W5QRXdS)N)�dry_runz	Removing z	Creating z
Writing %s�wzUTF-8)�encoding)rrr�isdir�islinkrZremove_treer�existsZexecute�unlinkr�makedirsr�info�openrZmetadataZwrite_pkg_file)r
r�frrr�run s�zinstall_egg_info.runcCs|jSr)rr	rrr�get_outputs.szinstall_egg_info.get_outputsN)	�__name__�
__module__�__qualname__ZdescriptionZuser_optionsr
rr'r(rrrrrs�
rcCst�dd|�S)N�[^A-Za-z0-9.]+�-)�re�sub��namerrrr6srcCs|�dd�}t�dd|�S)N� �.r,r-)�replacer.r/)�versionrrrr>srcCs|�dd�S)Nr-�_)r4r0rrrrHsr)Z
distutils.cmdrZ	distutilsrrrrr.rrrrrrrr�<module>s+
__pycache__/register.cpython-38.opt-2.pyc000064400000016030150513660020014166 0ustar00U

e5d�-�@s`ddlZddlZddlZddlZddlmZddlmZddl	Tddl
mZGdd�de�ZdS)�N)�warn)�
PyPIRCCommand)�*)�logc@s�eZdZdZejddgZejdddgZddd	�fgZd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zddd�ZdS) �registerz7register the distribution with the Python package index)�list-classifiersNz list the valid Trove classifiers)�strictNzBWill stop the registering if the meta-data are not fully compliant�verifyrr�checkcCsdS)NT���selfrr�2/usr/lib64/python3.8/distutils/command/register.py�<lambda>�zregister.<lambda>cCst�|�d|_d|_dS)Nr)r�initialize_options�list_classifiersrrrrrrs
zregister.initialize_optionscCs*t�|�d|jfdd�}||jjd<dS)Nr)r�)r�restructuredtextr
)r�finalize_optionsr�distributionZcommand_options)r
Z
check_optionsrrrr$s

�zregister.finalize_optionscCsT|��|��|��D]}|�|�q|jr8|��n|jrH|��n|��dS)N)	r�_set_configZget_sub_commandsZrun_commandZdry_run�verify_metadatar�classifiers�
send_metadata)r
Zcmd_namerrr�run+s

zregister.runcCs8tdt�|j�d�}|��|j|_d|_|��dS)Nzddistutils.command.register.check_metadata is deprecated,               use the check command insteadr
r)r�PendingDeprecationWarningrZget_command_objZensure_finalizedrrr)r
r
rrr�check_metadata:s�zregister.check_metadatacCsz|��}|ikr@|d|_|d|_|d|_|d|_d|_n6|jd|jfkr^td|j��|jdkrp|j|_d|_dS)	N�username�password�
repository�realmTZpypiz%s not found in .pypircF)Z_read_pypircrrr r!�
has_configZDEFAULT_REPOSITORY�
ValueError)r
ZconfigrrrrDs




zregister._set_configcCs*|jd}tj�|�}t�|�|��dS)Nz?:action=list_classifiers)r �urllib�requestZurlopenr�info�_read_pypi_response)r
ZurlZresponserrrrUs
zregister.classifierscCs&|�|�d��\}}t�d||�dS)Nr	�Server response (%s): %s)�post_to_server�build_post_datarr&)r
�code�resultrrrr\szregister.verify_metadatac
Cs�|jrd}|j}|j}nd}d}}d��}||krd|�dtj�t�}|sRd}q,||kr,td�q,|dk�rl|s|td�}qn|s�t	�	d�}q|t
j��}t
j
�|j�d	}|�|j|||�|�|�d
�|�\}}|�d||ftj�|dk�r�|j�r||j_nf|�d
tj�|�d|��tj�d}|��dk�rNtd�}|�s*d}�q*|��dk�r�|�||��nl|dk�r�ddi}	d|	d<|	d<|	d<d|	d<|	d�s�td�|	d<�q�|	d|	dk�r0|	d�s�t	�	d�|	d<�q�|	d�st	�	d�|	d<�q�|	d|	dk�r�d|	d<d|	d<td��q�|	d�sJtd�|	d<�q0|�|	�\}}|dk�rrt�d||�nt�d�t�d�nP|d k�r�dd!i}	d|	d<|	d�s�td"�|	d<�q�|�|	�\}}t�d||�dS)#N�1�x�z1 2 3 4z�We need to know who you are, so please choose either:
 1. use your existing login,
 2. register as a new user,
 3. have the server generate a new password for you (and email it to you), or
 4. quit
Your selection [default 1]: z&Please choose one of the four options!z
Username: z
Password: rZsubmitr(��zAI can store your PyPI login so future submissions will be faster.z (the login will be stored in %s)�XZynzSave your login (y/N)?�n�y�2�:action�user�namerZemailZconfirmz
 Confirm: z!Password and confirm don't match!z
   EMail: z"You will receive an email shortly.z7Follow the instructions in it to complete registration.�3Zpassword_resetzYour email address: )r"rr�split�announcer�INFO�input�print�getpassr$r%ZHTTPPasswordMgr�parseZurlparser Zadd_passwordr!r)r*rZ_get_rc_file�lowerZ
_store_pypircr&)
r
Zchoicerr�choices�authZhostr+r,�datarrrrcs��



��

���








zregister.send_metadatacCs�|jj}|d|��|��|��|��|��|��|��|�	�|�
�|��|��|�
�|��|��|��d�}|ds�|ds�|dr�d|d<|S)Nz1.0)r5�metadata_versionr7�versionZsummaryZ	home_pageZauthorZauthor_email�license�description�keywords�platformrZdownload_url�provides�requires�	obsoletesrJrKrLz1.1rD)rZmetadataZget_nameZget_versionZget_descriptionZget_urlZget_contactZget_contact_emailZget_licenceZget_long_descriptionZget_keywordsZ
get_platformsZget_classifiersZget_download_urlZget_providesZget_requiresZ
get_obsoletes)r
�action�metarCrrrr*�s,�zregister.build_post_dataNc
Cs�d|kr$|�d|d|jftj�d}d|}|d}t��}|��D]~\}}t|�tg�td�fkrn|g}|D]R}t|�}|�	|�|�	d|�|�	d�|�	|�|rr|d	d
krr|�	d�qrqH|�	|�|�	d�|�
��d�}d
|tt|��d�}	t
j�|j||	�}
t
j�t
jj|d��}d}z|�|
�}Wnxt
jjk
�r�}
z"|j�rd|
j��}|
j|
jf}W5d}
~
XYnJt
jjk
�r�}
zdt|
�f}W5d}
~
XYnX|j�r�|�|�}d}|j�r�d�d|df�}|�|tj�|S)Nr7zRegistering %s to %sz3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254z
--z--rz*
Content-Disposition: form-data; name="%s"z

����
�
zutf-8z/multipart/form-data; boundary=%s; charset=utf-8)zContent-typezContent-length)Zpassword_mgrr/i�)r0ZOKzK---------------------------------------------------------------------------)r:r rr;�io�StringIO�items�type�str�write�getvalue�encode�lenr$r%ZRequestZbuild_openerZHTTPBasicAuthHandler�open�errorZ	HTTPErrorZ
show_response�fp�readr+�msgZURLErrorr'�join)r
rCrB�boundaryZsep_boundaryZend_boundaryZbody�key�valueZheadersZreqZopenerr,�er_rrrr)�s^��





��

zregister.post_to_server)N)�__name__�
__module__�__qualname__rGrZuser_optionsZboolean_optionsZsub_commandsrrrrrrrrr*r)rrrrrs*��
zr)
r>rRZurllib.parser$Zurllib.request�warningsrZdistutils.corerZdistutils.errorsZ	distutilsrrrrrr�<module>s__pycache__/install_headers.cpython-38.pyc000064400000003256150513660030014552 0ustar00U

e5d�@s$dZddlmZGdd�de�ZdS)z�distutils.command.install_headers

Implements the Distutils 'install_headers' command, to install C/C++ header
files to the Python include directory.�)�Commandc@sFeZdZdZddgZdgZdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�install_headerszinstall C/C++ header files)zinstall-dir=�dz$directory to install header files to)�force�fz-force installation (overwrite existing files)rcCsd|_d|_g|_dS)Nr)�install_dirr�outfiles��self�r�9/usr/lib64/python3.8/distutils/command/install_headers.py�initialize_optionssz"install_headers.initialize_optionscCs|�ddd�dS)NZinstall)rr)rr)Zset_undefined_optionsr	rrr�finalize_optionss�z install_headers.finalize_optionscCsH|jj}|sdS|�|j�|D]"}|�||j�\}}|j�|�q dS�N)�distribution�headersZmkpathrZ	copy_filer�append)r
r�header�out�_rrr�run!szinstall_headers.runcCs|jjp
gSr)rrr	rrr�
get_inputs+szinstall_headers.get_inputscCs|jSr)rr	rrr�get_outputs.szinstall_headers.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsr
rrrrrrrrr
s�
rN)�__doc__Zdistutils.corerrrrrr�<module>s__pycache__/install_lib.cpython-38.opt-1.pyc000064400000011773150513660030014647 0ustar00U

e5d� �@sLdZddlZddlZddlZddlmZddlmZdZ	Gdd�de�Z
dS)zkdistutils.command.install_lib

Implements the Distutils 'install_lib' command
(install all Python modules).�N)�Command)�DistutilsOptionErrorz.pyc@s�eZdZdZdddddddgZd	d
dgZdd
iZd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!S)"�install_libz7install all Python modules (extensions and pure Python))zinstall-dir=�dzdirectory to install to)z
build-dir=�bz'build directory (where to install from))�force�fz-force installation (overwrite existing files))�compile�czcompile .py to .pyc [default])�
no-compileNzdon't compile .py files)z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�
skip-buildNzskip the build stepsrr	r
rcCs(d|_d|_d|_d|_d|_d|_dS)Nr)�install_dir�	build_dirrr	�optimize�
skip_build��self�r�5/usr/lib64/python3.8/distutils/command/install_lib.py�initialize_options3szinstall_lib.initialize_optionsc	Cs�|�ddddddd�|jdkr&d|_|jdkr6d	|_t|jt�s�zt|j�|_|jd
kr^t�Wn ttfk
r�td��YnXdS)N�install)�	build_libr)rr)rr)r	r	)rr)rrTF)r��zoptimize must be 0, 1, or 2)Zset_undefined_optionsr	r�
isinstance�int�AssertionError�
ValueErrorrrrrr�finalize_options<s&�	


zinstall_lib.finalize_optionscCs0|��|��}|dk	r,|j��r,|�|�dS�N)�buildr�distribution�has_pure_modules�byte_compile�rZoutfilesrrr�runVszinstall_lib.runcCs2|js.|j��r|�d�|j��r.|�d�dS)N�build_py�	build_ext)rr"r#Zrun_command�has_ext_modulesrrrrr!fs



zinstall_lib.buildcCs8tj�|j�r |�|j|j�}n|�d|j�dS|S)Nz3'%s' does not exist -- no Python modules to install)�os�path�isdirrZ	copy_treer�warnr%rrrrms�zinstall_lib.installcCsrtjr|�d�dSddlm}|�d�j}|jrH||d|j||j	d�|j
dkrn|||j
|j||j|j	d�dS)Nz%byte-compiling is disabled, skipping.r)r$r)rr�prefix�dry_run)rrr.�verboser/)�sys�dont_write_bytecoder-Zdistutils.utilr$�get_finalized_command�rootr	rr/rr0)r�filesr$Zinstall_rootrrrr$vs$
�
�zinstall_lib.byte_compilec
	Csd|sgS|�|�}|��}t||�}t|�ttj�}g}|D] }	|�tj�||	|d���q>|Sr )	r3�get_outputs�getattr�lenr*�sep�appendr+�join)
rZhas_anyZ	build_cmdZ
cmd_optionZ
output_dirZbuild_filesr�
prefix_lenZoutputs�filerrr�_mutate_outputs�s

zinstall_lib._mutate_outputscCsrg}|D]d}tj�tj�|��d}|tkr.q|jrJ|�tjj	|dd��|j
dkr|�tjj	||j
d��q|S)Nr�)�optimizationr)r*r+�splitext�normcase�PYTHON_SOURCE_EXTENSIONr	r:�	importlib�util�cache_from_sourcer)rZpy_filenamesZbytecode_filesZpy_fileZextrrr�_bytecode_filenames�s 
�

�
zinstall_lib._bytecode_filenamescCsR|�|j��dd|j�}|jr*|�|�}ng}|�|j��dd|j�}|||S)z�Return the list of files that would be installed if this command
        were actually run.  Not affected by the "dry-run" flag or whether
        modules have actually been built yet.
        r'rr()r>r"r#rr	rGr))rZpure_outputsZbytecode_outputsZext_outputsrrrr6�s ����zinstall_lib.get_outputscCsLg}|j��r&|�d�}|�|���|j��rH|�d�}|�|���|S)z�Get the list of files that are input to this command, ie. the
        files that get installed as they are named in the build tree.
        The files in this list correspond one-to-one to the output
        filenames returned by 'get_outputs()'.
        r'r()r"r#r3�extendr6r))rZinputsr'r(rrr�
get_inputs�s



zinstall_lib.get_inputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optrrr&r!rr$r>rGr6rIrrrrrs*�
		r)�__doc__r*�importlib.utilrDr1Zdistutils.corerZdistutils.errorsrrCrrrrr�<module>s__pycache__/bdist_wininst.cpython-38.opt-1.pyc000064400000020351150513660030015223 0ustar00U

e5d�>�@sxdZddlZddlZddlZddlmZddlmZddlm	Z	m
Z
ddlTddlm
Z
ddlmZGd	d
�d
e�ZdS)zzdistutils.command.bdist_wininst

Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program.�N)�Command)�get_platform)�create_tree�remove_tree)�*)�get_python_version)�logc
s�eZdZdZdddde�fdddd	d
ddd
dddg
ZddddgZejdkZ	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zd'd!d"�Zd#d$�Zd%d&�Z�ZS)(�
bdist_wininstz-create an executable installer for MS Windows)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)�no-target-compile�cz/do not compile .py to .pyc on the target system)�no-target-optimize�oz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=�dz-directory to put final built distributions in)zbitmap=�bz>bitmap to use for the installer instead of python-powered logo)ztitle=�tz?title to display on the installer background instead of default)�
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distribution)zuser-access-control=Nz�specify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UACrr
rr�win32cs t�j||�t�dtd�dS)Nz^bdist_wininst command is deprecated since Python 3.8, use bdist_wheel (wheel packages) instead�)�super�__init__�warnings�warn�DeprecationWarning)�self�args�kw��	__class__��7/usr/lib64/python3.8/distutils/command/bdist_wininst.pyr?s
�zbdist_wininst.__init__cCsRd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_dS)Nr)
�	bdist_dir�	plat_name�	keep_temp�no_target_compile�no_target_optimize�target_version�dist_dir�bitmap�title�
skip_build�install_script�pre_install_script�user_access_control)rr!r!r"�initialize_optionsEsz bdist_wininst.initialize_optionscCs�|�dd�|jdkrR|jr6|jr6|j�d�}|j|_|�d�j}tj	�
|d�|_|js^d|_|js�|j��r�t
�}|jr�|j|kr�td|f��||_|�ddd�|jr�|jjD]}|jtj	�|�kr�q�q�td|j��dS)	N�bdist)r,r,Zwininst�zMtarget version can only be %s, or the '--skip-build' option must be specified)r)r))r$r$z(install_script '%s' not found in scripts)Zset_undefined_optionsr#r,r$�distributionZget_command_obj�get_finalized_command�
bdist_base�os�path�joinr(�has_ext_modulesrZDistutilsOptionErrorr-�scripts�basename)rr1r5Z
short_version�scriptr!r!r"�finalize_optionsUs>
�����zbdist_wininst.finalize_optionsc
Cs�tjdkr&|j��s|j��r&td��|js6|�d�|jddd�}|j	|_
|j|_d|_|j|_|�d�}d|_
d|_|j��r�|j}|s�d	tjdd
�}d|j|f}|�d�}tj�|jd|�|_d
D],}|��}|dkr�|d}t|d||�q�t�d|j	�|��tj�dtj�|j	d��|��tjd=ddlm}|�}	|j� �}
|j!|	d|j	d�}|�"||
|j#�|j���r�t$�}nd}|jj%�&d||�'|
�f�t�(d|�t�)|�|j*�s�t+|j	|j,d�dS)Nrz^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platform�build�install�)Zreinit_subcommandsr�install_libz%d.%drz.%s-%s�lib)ZpurelibZplatlib�headersr:�datarCz/Include/$dist_nameZinstall_zinstalling to %sZPURELIB)�mktemp�zip)Zroot_dir�anyr	zremoving temporary file '%s')�dry_run)-�sys�platformr3r9Zhas_c_librariesZDistutilsPlatformErrorr,Zrun_commandZreinitialize_commandr#�rootZwarn_dirr$�compile�optimizer(�version_infor4r6r7r8Z
build_baseZ	build_lib�upper�setattrr�infoZensure_finalized�insert�runZtempfilerE�get_fullnameZmake_archive�
create_exer*rZ
dist_files�append�get_installer_filename�debug�remover%rrH)
rr?rAr(Zplat_specifierr>�key�valuerEZarchive_basename�fullname�arcnameZ	pyversionr!r!r"rS{sr
���




��
��
zbdist_wininst.runcCsZg}|jj}|�d�|jpdd}dd�}dD]B}t||d�}|r0|d|��||�f}|�d|||�f�q0|�d	�|jr�|�d
|j�|�d||��|�d|j�|�d
|j�|j	r�|�d|j	�|j
r�|�d|j
�|j�p|j��}|�d||��ddl
}ddl}	d|�|�
��|	jf}
|�d|
�d�|�S)Nz
[metadata]r2�
cSs|�dd�S)Nr^z\n)�replace)�sr!r!r"�escape�sz)bdist_wininst.get_inidata.<locals>.escape)ZauthorZauthor_email�descriptionZ
maintainerZmaintainer_email�nameZurl�versionz
    %s: %sz%s=%sz
[Setup]zinstall_script=%szinfo=%sztarget_compile=%dztarget_optimize=%dztarget_version=%szuser_access_control=%sztitle=%srzBuilt %s with distutils-%sz
build_info=%s)r3�metadatarVZlong_description�getattr�
capitalizer-r&r'r(r/r+rT�time�	distutils�ctime�__version__r8)r�linesrerQrarcrDr+rhriZ
build_infor!r!r"�get_inidata�s>
�
�zbdist_wininst.get_inidataNc
CsHddl}|�|j�|��}|�|�}|�d|�|r`t|d��}|��}W5QRXt|�}	nd}	t|d���}
|
�	|�
��|r�|
�	|�t|t�r�|�
d�}|d}|jr�t|jddd	��}|���
d�}W5QRX||d
}n|d}|
�	|�|�ddt|�|	�}
|
�	|
�t|d��}|
�	|���W5QRXW5QRXdS)
Nrzcreating %s�rb�wb�mbcs��rzlatin-1)�encodings
z<iiii{V4)�structZmkpathr)rmrWZannounce�open�read�len�write�
get_exe_bytes�
isinstance�str�encoder.Zpack)rr]r\r*rtZcfgdata�installer_name�fZ
bitmapdataZ	bitmaplen�filer<Zscript_data�headerr!r!r"rU�sD




�
�
zbdist_wininst.create_execCsD|jr&tj�|jd||j|jf�}ntj�|jd||jf�}|S)Nz%s.%s-py%s.exez	%s.%s.exe)r(r6r7r8r)r$)rr\r}r!r!r"rW1s
��
�z$bdist_wininst.get_installer_filenamec	Cs$t�}|jrl|j|krl|jdkr&d}q�|jdkr6d}q�|jdkrFd}q�|jdkrVd}q�|jdkrfd	}q�d
}n@zddlm}Wntk
r�d
}YnX|�d
�d}|d}tj�t	�}|j
dkr�|j
dd�dkr�|j
dd�}nd}tj�|d||f�}t|d�}z|��W�S|�
�XdS)Nz2.4z6.0z7.1z2.5z8.0z3.2z9.0z3.4z10.0z14.0r)�CRT_ASSEMBLY_VERSION�.z.0r��winr2zwininst-%s%s.exern)rr(Zmsvcrtr��ImportError�	partitionr6r7�dirname�__file__r$r8ru�closerv)	rZcur_versionZbvr��majorZ	directoryZsfix�filenamer~r!r!r"ry>s8	






zbdist_wininst.get_exe_bytes)N)�__name__�
__module__�__qualname__rbrZuser_optionsZboolean_optionsrIrJZ_unsupportedrr0r=rSrmrUrWry�
__classcell__r!r!rr"r	s>���%�
&Q.
7
r	)�__doc__r6rIrZdistutils.corerZdistutils.utilrZdistutils.dir_utilrrZdistutils.errorsZdistutils.sysconfigrrirr	r!r!r!r"�<module>s__pycache__/bdist_dumb.cpython-38.opt-1.pyc000064400000007012150513660030014456 0ustar00U

e5d1�@shdZddlZddlmZddlmZddlmZmZddl	Tddl
mZddlm
Z
Gd	d
�d
e�ZdS)z�distutils.command.bdist_dumb

Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix).�N)�Command)�get_platform)�remove_tree�ensure_relative)�*)�get_python_version)�logc	@s^eZdZdZdddde�fdddd	d
ddg	Zd
ddgZddd�Zdd�Zdd�Z	dd�Z
dS)�
bdist_dumbz"create a "dumb" built distribution)z
bdist-dir=�dz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))zformat=�fz>archive format to create (tar, gztar, bztar, xztar, ztar, zip))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)z	dist-dir=r
z-directory to put final built distributions in)�
skip-buildNz2skip rebuilding everything (for testing/debugging))�relativeNz7build the archive using relative paths (default: false))zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]r
rrZgztar�zip)�posix�ntcCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	�	bdist_dir�	plat_name�format�	keep_temp�dist_dir�
skip_buildr�owner�group)�self�r�4/usr/lib64/python3.8/distutils/command/bdist_dumb.py�initialize_options2szbdist_dumb.initialize_optionscCsz|jdkr&|�d�j}tj�|d�|_|jdkrfz|jtj|_Wn"t	k
rdt
dtj��YnX|�dddd�dS)NZbdistZdumbz@don't know how to create dumb built distributions on platform %s)rr)rr)rr)rZget_finalized_command�
bdist_base�os�path�joinr�default_format�name�KeyError�DistutilsPlatformErrorZset_undefined_options)rr"rrr �finalize_options=s"

��
�zbdist_dumb.finalize_optionscCs(|js|�d�|jddd�}|j|_|j|_d|_t�d|j�|�d�d|j�	�|j
f}tj�
|j|�}|js~|j}nJ|j��r�|j|jkr�tdt|j�t|j�f��ntj�
|jt|j��}|j||j||j|jd	�}|j��r�t�}nd
}|jj�d||f�|j�s$t|j|jd�dS)
NZbuild�install�)Zreinit_subcommandsrzinstalling to %sz%s.%szScan't make a dumb built distribution where base and platbase are different (%s, %s))Zroot_dirrr�anyr	)�dry_run) rZrun_commandZreinitialize_commandr�rootZwarn_dirr�infoZdistributionZget_fullnamerr#r$r%rrZhas_ext_modulesZinstall_baseZinstall_platbaser)�reprrZmake_archiverrrrZ
dist_files�appendrrr.)rr+Zarchive_basenameZpseudoinstall_rootZarchive_root�filenameZ	pyversionrrr �runOsR


�

����
��
�zbdist_dumb.runN)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsr&r!r*r4rrrr r	s,���
�r	)�__doc__r#Zdistutils.corerZdistutils.utilrZdistutils.dir_utilrrZdistutils.errorsZdistutils.sysconfigrZ	distutilsrr	rrrr �<module>s__pycache__/install_lib.cpython-38.pyc000064400000011773150513660030013710 0ustar00U

e5d� �@sLdZddlZddlZddlZddlmZddlmZdZ	Gdd�de�Z
dS)zkdistutils.command.install_lib

Implements the Distutils 'install_lib' command
(install all Python modules).�N)�Command)�DistutilsOptionErrorz.pyc@s�eZdZdZdddddddgZd	d
dgZdd
iZd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!S)"�install_libz7install all Python modules (extensions and pure Python))zinstall-dir=�dzdirectory to install to)z
build-dir=�bz'build directory (where to install from))�force�fz-force installation (overwrite existing files))�compile�czcompile .py to .pyc [default])�
no-compileNzdon't compile .py files)z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�
skip-buildNzskip the build stepsrr	r
rcCs(d|_d|_d|_d|_d|_d|_dS)Nr)�install_dir�	build_dirrr	�optimize�
skip_build��self�r�5/usr/lib64/python3.8/distutils/command/install_lib.py�initialize_options3szinstall_lib.initialize_optionsc	Cs�|�ddddddd�|jdkr&d|_|jdkr6d	|_t|jt�s�zt|j�|_|jd
kr^t�Wn ttfk
r�td��YnXdS)N�install)�	build_libr)rr)rr)r	r	)rr)rrTF)r��zoptimize must be 0, 1, or 2)Zset_undefined_optionsr	r�
isinstance�int�AssertionError�
ValueErrorrrrrr�finalize_options<s&�	


zinstall_lib.finalize_optionscCs0|��|��}|dk	r,|j��r,|�|�dS�N)�buildr�distribution�has_pure_modules�byte_compile�rZoutfilesrrr�runVszinstall_lib.runcCs2|js.|j��r|�d�|j��r.|�d�dS)N�build_py�	build_ext)rr"r#Zrun_command�has_ext_modulesrrrrr!fs



zinstall_lib.buildcCs8tj�|j�r |�|j|j�}n|�d|j�dS|S)Nz3'%s' does not exist -- no Python modules to install)�os�path�isdirrZ	copy_treer�warnr%rrrrms�zinstall_lib.installcCsrtjr|�d�dSddlm}|�d�j}|jrH||d|j||j	d�|j
dkrn|||j
|j||j|j	d�dS)Nz%byte-compiling is disabled, skipping.r)r$r)rr�prefix�dry_run)rrr.�verboser/)�sys�dont_write_bytecoder-Zdistutils.utilr$�get_finalized_command�rootr	rr/rr0)r�filesr$Zinstall_rootrrrr$vs$
�
�zinstall_lib.byte_compilec
	Csd|sgS|�|�}|��}t||�}t|�ttj�}g}|D] }	|�tj�||	|d���q>|Sr )	r3�get_outputs�getattr�lenr*�sep�appendr+�join)
rZhas_anyZ	build_cmdZ
cmd_optionZ
output_dirZbuild_filesr�
prefix_lenZoutputs�filerrr�_mutate_outputs�s

zinstall_lib._mutate_outputscCsrg}|D]d}tj�tj�|��d}|tkr.q|jrJ|�tjj	|dd��|j
dkr|�tjj	||j
d��q|S)Nr�)�optimizationr)r*r+�splitext�normcase�PYTHON_SOURCE_EXTENSIONr	r:�	importlib�util�cache_from_sourcer)rZpy_filenamesZbytecode_filesZpy_fileZextrrr�_bytecode_filenames�s 
�

�
zinstall_lib._bytecode_filenamescCsR|�|j��dd|j�}|jr*|�|�}ng}|�|j��dd|j�}|||S)z�Return the list of files that would be installed if this command
        were actually run.  Not affected by the "dry-run" flag or whether
        modules have actually been built yet.
        r'rr()r>r"r#rr	rGr))rZpure_outputsZbytecode_outputsZext_outputsrrrr6�s ����zinstall_lib.get_outputscCsLg}|j��r&|�d�}|�|���|j��rH|�d�}|�|���|S)z�Get the list of files that are input to this command, ie. the
        files that get installed as they are named in the build tree.
        The files in this list correspond one-to-one to the output
        filenames returned by 'get_outputs()'.
        r'r()r"r#r3�extendr6r))rZinputsr'r(rrr�
get_inputs�s



zinstall_lib.get_inputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optrrr&r!rr$r>rGr6rIrrrrrs*�
		r)�__doc__r*�importlib.utilrDr1Zdistutils.corerZdistutils.errorsrrCrrrrr�<module>s__pycache__/bdist_wininst.cpython-38.opt-2.pyc000064400000020136150513660030015225 0ustar00U

e5d�>�@stddlZddlZddlZddlmZddlmZddlmZm	Z	ddl
TddlmZddl
mZGdd	�d	e�ZdS)
�N)�Command)�get_platform)�create_tree�remove_tree)�*)�get_python_version)�logc
s�eZdZdZdddde�fdddd	d
ddd
dddg
ZddddgZejdkZ	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zd'd!d"�Zd#d$�Zd%d&�Z�ZS)(�
bdist_wininstz-create an executable installer for MS Windows)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)�no-target-compile�cz/do not compile .py to .pyc on the target system)�no-target-optimize�oz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=�dz-directory to put final built distributions in)zbitmap=�bz>bitmap to use for the installer instead of python-powered logo)ztitle=�tz?title to display on the installer background instead of default)�
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distribution)zuser-access-control=Nz�specify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UACrr
rr�win32cs t�j||�t�dtd�dS)Nz^bdist_wininst command is deprecated since Python 3.8, use bdist_wheel (wheel packages) instead�)�super�__init__�warnings�warn�DeprecationWarning)�self�args�kw��	__class__��7/usr/lib64/python3.8/distutils/command/bdist_wininst.pyr?s
�zbdist_wininst.__init__cCsRd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_dS)Nr)
�	bdist_dir�	plat_name�	keep_temp�no_target_compile�no_target_optimize�target_version�dist_dir�bitmap�title�
skip_build�install_script�pre_install_script�user_access_control)rr!r!r"�initialize_optionsEsz bdist_wininst.initialize_optionscCs�|�dd�|jdkrR|jr6|jr6|j�d�}|j|_|�d�j}tj	�
|d�|_|js^d|_|js�|j��r�t
�}|jr�|j|kr�td|f��||_|�ddd�|jr�|jjD]}|jtj	�|�kr�q�q�td|j��dS)	N�bdist)r,r,Zwininst�zMtarget version can only be %s, or the '--skip-build' option must be specified)r)r))r$r$z(install_script '%s' not found in scripts)Zset_undefined_optionsr#r,r$�distributionZget_command_obj�get_finalized_command�
bdist_base�os�path�joinr(�has_ext_modulesrZDistutilsOptionErrorr-�scripts�basename)rr1r5Z
short_version�scriptr!r!r"�finalize_optionsUs>
�����zbdist_wininst.finalize_optionsc
Cs�tjdkr&|j��s|j��r&td��|js6|�d�|jddd�}|j	|_
|j|_d|_|j|_|�d�}d|_
d|_|j��r�|j}|s�d	tjdd
�}d|j|f}|�d�}tj�|jd|�|_d
D],}|��}|dkr�|d}t|d||�q�t�d|j	�|��tj�dtj�|j	d��|��tjd=ddlm}|�}	|j� �}
|j!|	d|j	d�}|�"||
|j#�|j���r�t$�}nd}|jj%�&d||�'|
�f�t�(d|�t�)|�|j*�s�t+|j	|j,d�dS)Nrz^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platform�build�install�)Zreinit_subcommandsr�install_libz%d.%drz.%s-%s�lib)ZpurelibZplatlib�headersr:�datarCz/Include/$dist_nameZinstall_zinstalling to %sZPURELIB)�mktemp�zip)Zroot_dir�anyr	zremoving temporary file '%s')�dry_run)-�sys�platformr3r9Zhas_c_librariesZDistutilsPlatformErrorr,Zrun_commandZreinitialize_commandr#�rootZwarn_dirr$�compile�optimizer(�version_infor4r6r7r8Z
build_baseZ	build_lib�upper�setattrr�infoZensure_finalized�insert�runZtempfilerE�get_fullnameZmake_archive�
create_exer*rZ
dist_files�append�get_installer_filename�debug�remover%rrH)
rr?rAr(Zplat_specifierr>�key�valuerEZarchive_basename�fullname�arcnameZ	pyversionr!r!r"rS{sr
���




��
��
zbdist_wininst.runcCsZg}|jj}|�d�|jpdd}dd�}dD]B}t||d�}|r0|d|��||�f}|�d|||�f�q0|�d	�|jr�|�d
|j�|�d||��|�d|j�|�d
|j�|j	r�|�d|j	�|j
r�|�d|j
�|j�p|j��}|�d||��ddl
}ddl}	d|�|�
��|	jf}
|�d|
�d�|�S)Nz
[metadata]r2�
cSs|�dd�S)Nr^z\n)�replace)�sr!r!r"�escape�sz)bdist_wininst.get_inidata.<locals>.escape)ZauthorZauthor_email�descriptionZ
maintainerZmaintainer_email�nameZurl�versionz
    %s: %sz%s=%sz
[Setup]zinstall_script=%szinfo=%sztarget_compile=%dztarget_optimize=%dztarget_version=%szuser_access_control=%sztitle=%srzBuilt %s with distutils-%sz
build_info=%s)r3�metadatarVZlong_description�getattr�
capitalizer-r&r'r(r/r+rT�time�	distutils�ctime�__version__r8)r�linesrerQrarcrDr+rhriZ
build_infor!r!r"�get_inidata�s>
�
�zbdist_wininst.get_inidataNc
CsHddl}|�|j�|��}|�|�}|�d|�|r`t|d��}|��}W5QRXt|�}	nd}	t|d���}
|
�	|�
��|r�|
�	|�t|t�r�|�
d�}|d}|jr�t|jddd	��}|���
d�}W5QRX||d
}n|d}|
�	|�|�ddt|�|	�}
|
�	|
�t|d��}|
�	|���W5QRXW5QRXdS)
Nrzcreating %s�rb�wb�mbcs��rzlatin-1)�encodings
z<iiii{V4)�structZmkpathr)rmrWZannounce�open�read�len�write�
get_exe_bytes�
isinstance�str�encoder.Zpack)rr]r\r*rtZcfgdata�installer_name�fZ
bitmapdataZ	bitmaplen�filer<Zscript_data�headerr!r!r"rU�sD




�
�
zbdist_wininst.create_execCsD|jr&tj�|jd||j|jf�}ntj�|jd||jf�}|S)Nz%s.%s-py%s.exez	%s.%s.exe)r(r6r7r8r)r$)rr\r}r!r!r"rW1s
��
�z$bdist_wininst.get_installer_filenamec	Cs$t�}|jrl|j|krl|jdkr&d}q�|jdkr6d}q�|jdkrFd}q�|jdkrVd}q�|jdkrfd	}q�d
}n@zddlm}Wntk
r�d
}YnX|�d
�d}|d}tj�t	�}|j
dkr�|j
dd�dkr�|j
dd�}nd}tj�|d||f�}t|d�}z|��W�S|�
�XdS)Nz2.4z6.0z7.1z2.5z8.0z3.2z9.0z3.4z10.0z14.0r)�CRT_ASSEMBLY_VERSION�.z.0r��winr2zwininst-%s%s.exern)rr(Zmsvcrtr��ImportError�	partitionr6r7�dirname�__file__r$r8ru�closerv)	rZcur_versionZbvr��majorZ	directoryZsfix�filenamer~r!r!r"ry>s8	






zbdist_wininst.get_exe_bytes)N)�__name__�
__module__�__qualname__rbrZuser_optionsZboolean_optionsrIrJZ_unsupportedrr0r=rSrmrUrWry�
__classcell__r!r!rr"r	s>���%�
&Q.
7
r	)r6rIrZdistutils.corerZdistutils.utilrZdistutils.dir_utilrrZdistutils.errorsZdistutils.sysconfigrrirr	r!r!r!r"�<module>s__pycache__/install_egg_info.cpython-38.opt-1.pyc000064400000005666150513660030015662 0ustar00U

e5d+
�@sddZddlmZddlmZmZddlZddlZddlZGdd�de�Z	dd�Z
d	d
�Zdd�ZdS)
z�distutils.command.install_egg_info

Implements the Distutils 'install_egg_info' command, for installing
a package's PKG-INFO metadata.�)�Command)�log�dir_utilNc@s:eZdZdZdZdgZdd�Zdd�Zdd	�Zd
d�Z	dS)
�install_egg_infoz)Install an .egg-info file for the packagez8Install package's PKG-INFO metadata as an .egg-info file)zinstall-dir=�dzdirectory to install tocCs
d|_dS�N)�install_dir��self�r�:/usr/lib64/python3.8/distutils/command/install_egg_info.py�initialize_optionssz#install_egg_info.initialize_optionscCsb|�dd�dtt|j����tt|j����ftjdd��}t	j
�|j|�|_
|j
g|_dS)NZinstall_lib)rrz%s-%s-py%d.%d.egg-info�)Zset_undefined_options�to_filename�	safe_name�distributionZget_name�safe_versionZget_version�sys�version_info�os�path�joinr�target�outputs)r
�basenamerrr�finalize_optionss��z!install_egg_info.finalize_optionsc	Cs�|j}tj�|�r0tj�|�s0tj||jd�nNtj�|�rV|�	tj
|jfd|�n(tj�|j�s~|�	tj|jfd|j�t
�d|�|js�t|ddd��}|jj�|�W5QRXdS)N)�dry_runz	Removing z	Creating z
Writing %s�wzUTF-8)�encoding)rrr�isdir�islinkrZremove_treer�existsZexecute�unlinkr�makedirsr�info�openrZmetadataZwrite_pkg_file)r
r�frrr�run s�zinstall_egg_info.runcCs|jSr)rr	rrr�get_outputs.szinstall_egg_info.get_outputsN)
�__name__�
__module__�__qualname__�__doc__ZdescriptionZuser_optionsr
rr'r(rrrrrs�
rcCst�dd|�S)z�Convert an arbitrary string to a standard distribution name

    Any runs of non-alphanumeric/. characters are replaced with a single '-'.
    �[^A-Za-z0-9.]+�-)�re�sub��namerrrr6srcCs|�dd�}t�dd|�S)z�Convert an arbitrary string to a standard version string

    Spaces become dots, and all other non-alphanumeric characters become
    dashes, with runs of multiple dashes condensed to a single dash.
    � �.r-r.)�replacer/r0)�versionrrrr>srcCs|�dd�S)z|Convert a project or version name to its filename-escaped form

    Any '-' characters are currently replaced with '_'.
    r.�_)r5r1rrrrHsr)
r,Z
distutils.cmdrZ	distutilsrrrrr/rrrrrrrr�<module>s+
__pycache__/sdist.cpython-38.opt-1.pyc000064400000034266150513660030013503 0ustar00U

e5d=J�@s�dZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZmZdd�ZGdd�de�ZdS)zadistutils.command.sdist

Implements the Distutils 'sdist' command (create a source distribution).�N)�glob)�warn)�Command)�dir_util)�	file_util)�archive_util)�TextFile)�FileList)�log)�convert_path)�DistutilsTemplateError�DistutilsOptionErrorcCs`ddlm}ddlm}g}|��D] }|�d|d||df�q$|��||��d�dS)zoPrint all possible values for the 'formats' option (used by
    the "--help-formats" command-line option).
    r)�FancyGetopt)�ARCHIVE_FORMATS�formats=N�z.List of available source distribution formats:)Zdistutils.fancy_getoptrZdistutils.archive_utilr�keys�append�sortZ
print_help)rr�formats�format�r�//usr/lib64/python3.8/distutils/command/sdist.py�show_formatss
��rc@s"eZdZdZdd�Zdddddd	d
ddd
ddddgZddddddgZdddefgZddd�Z	defgZ
dZdd�Zd d!�Z
d"d#�Zd$d%�Zd&d'�Zd(d)�Zed*d+��Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Zd@dA�ZdBdC�ZdDdE�Z dFdG�Z!dHdI�Z"dS)J�sdistz6create a source distribution (tarball, zip file, etc.)cCs|jS)zYCallable used for the check sub-command.

        Placed here so user_options can view it)�metadata_check��selfrrr�checking_metadata(szsdist.checking_metadata)z	template=�tz5name of manifest template file [default: MANIFEST.in])z	manifest=�mz)name of manifest file [default: MANIFEST])�use-defaultsNzRinclude the default file set in the manifest [default; disable with --no-defaults])�no-defaultsNz"don't include the default file set)�pruneNz�specifically exclude files/directories that should not be distributed (build tree, RCS/CVS dirs, etc.) [default; disable with --no-prune])�no-pruneNz$don't automatically exclude anything)�
manifest-only�ozEjust regenerate the manifest and then stop (implies --force-manifest))�force-manifest�fzkforcibly regenerate the manifest and carry on as usual. Deprecated: now the manifest is always regenerated.)rNz6formats for source distribution (comma-separated list))�	keep-temp�kz@keep the distribution tree around after creating archive file(s))z	dist-dir=�dzFdirectory to put the source distribution archive(s) in [default: dist])�metadata-checkNz[Ensure that all required elements of meta-data are supplied. Warn if any missing. [default])zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]r!r#r%r'r)r,zhelp-formatsNz#list available distribution formats)r"r$�check)ZREADMEz
README.txtz
README.rstcCsTd|_d|_d|_d|_d|_d|_dg|_d|_d|_d|_	d|_
d|_d|_dS)N�rZgztar)
�template�manifest�use_defaultsr#�
manifest_onlyZforce_manifestr�	keep_temp�dist_dir�
archive_filesr�owner�grouprrrr�initialize_optionseszsdist.initialize_optionscCsZ|jdkrd|_|jdkr d|_|�d�t�|j�}|rFtd|��|jdkrVd|_dS)NZMANIFESTzMANIFEST.inrzunknown archive format '%s'Zdist)r2r1Zensure_string_listrZcheck_archive_formatsrr
r6)rZ
bad_formatrrr�finalize_options|s


�
zsdist.finalize_optionscCs>t�|_|��D]}|�|�q|��|jr2dS|��dS�N)r	�filelistZget_sub_commandsZrun_command�
get_file_listr4�make_distribution)rZcmd_namerrr�run�sz	sdist.runcCs*tdt�|j�d�}|��|��dS)zDeprecated API.zadistutils.command.sdist.check_metadata is deprecated,               use the check command insteadr/N)r�PendingDeprecationWarning�distributionZget_command_objZensure_finalizedr@)rr/rrr�check_metadata�s�zsdist.check_metadatacCs�tj�|j�}|s:|��r:|��|j��|j��dS|sN|�	d|j�|j�
�|jrf|��|rr|�
�|jr�|��|j��|j��|��dS)aCFigure out the list of files to include in the source
        distribution, and put it in 'self.filelist'.  This might involve
        reading the manifest template (and writing the manifest), or just
        reading the manifest, or just using the default file set -- it all
        depends on the user's options.
        Nz?manifest template '%s' does not exist (using default file list))�os�path�isfiler1�_manifest_is_not_generated�
read_manifestr=rZremove_duplicatesr�findallr3�add_defaults�
read_templater#�prune_file_list�write_manifest)rZtemplate_existsrrrr>�s(

�


zsdist.get_file_listcCs<|��|��|��|��|��|��|��dS)a9Add all the default files to self.filelist:
          - README or README.txt
          - setup.py
          - test/test*.py
          - all pure Python modules mentioned in setup script
          - all files pointed by package_data (build_py)
          - all files defined in data_files.
          - all files defined as scripts.
          - all C sources listed as part of extensions or C libraries
            in the setup script (doesn't catch C headers!)
        Warns if (README or README.txt) or setup.py are missing; everything
        else is optional.
        N)�_add_defaults_standards�_add_defaults_optional�_add_defaults_python�_add_defaults_data_files�_add_defaults_ext�_add_defaults_c_libs�_add_defaults_scriptsrrrrrJ�szsdist.add_defaultscCs:tj�|�sdStj�|�}tj�|�\}}|t�|�kS)z�
        Case-sensitive path existence check

        >>> sdist._cs_path_exists(__file__)
        True
        >>> sdist._cs_path_exists(__file__.upper())
        False
        F)rDrE�exists�abspath�split�listdir)�fspathrVZ	directory�filenamerrr�_cs_path_exists�s

zsdist._cs_path_existscCs�|j|jjg}|D]~}t|t�rj|}d}|D]"}|�|�r,d}|j�|�qPq,|s�|�dd�	|��q|�|�r�|j�|�q|�d|�qdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found)
�READMESrBZscript_name�
isinstance�tupler[r=rr�join)rZ	standards�fnZaltsZgot_itrrrrN�s"

�
zsdist._add_defaults_standardscCs4ddg}|D]"}ttjjt|��}|j�|�qdS)Nz
test/test*.pyz	setup.cfg)�filterrDrErFrr=�extend)rZoptional�pattern�filesrrrrOszsdist._add_defaults_optionalcCs\|�d�}|j��r$|j�|���|jD],\}}}}|D]}|j�tj	�
||��q:q*dS)N�build_py)�get_finalized_commandrBZhas_pure_modulesr=rb�get_source_files�
data_filesrrDrEr_)rreZpkgZsrc_dirZ	build_dir�	filenamesrZrrrrPs

zsdist._add_defaults_pythoncCsz|j��rv|jjD]b}t|t�rBt|�}tj�|�rt|j	�
|�q|\}}|D]$}t|�}tj�|�rN|j	�
|�qNqdSr<)rBZhas_data_filesrhr]�strrrDrErFr=r)r�item�dirnamerir(rrrrQ$s

zsdist._add_defaults_data_filescCs(|j��r$|�d�}|j�|���dS)N�	build_ext)rBZhas_ext_modulesrfr=rbrg)rrmrrrrR5s

zsdist._add_defaults_extcCs(|j��r$|�d�}|j�|���dS)N�
build_clib)rBZhas_c_librariesrfr=rbrg)rrnrrrrS:s

zsdist._add_defaults_c_libscCs(|j��r$|�d�}|j�|���dS)N�
build_scripts)rBZhas_scriptsrfr=rbrg)rrorrrrT?s

zsdist._add_defaults_scriptsc
Cs�t�d|j�t|jddddddd�}zh|��}|dkr:q�z|j�|�Wq(tt	fk
r�}z|�
d|j|j|f�W5d}~XYq(Xq(W5|��XdS)z�Read and parse manifest template file named by self.template.

        (usually "MANIFEST.in") The parsing and processing is done by
        'self.filelist', which updates itself accordingly.
        zreading manifest template '%s'r0)Zstrip_commentsZskip_blanksZ
join_linesZ	lstrip_wsZ	rstrip_wsZ
collapse_joinNz%s, line %d: %s)
r
�infor1r�close�readliner=Zprocess_template_liner�
ValueErrorrrZZcurrent_line)rr1�line�msgrrrrKDs&
�
� zsdist.read_templatecCs�|�d�}|j��}|jjd|jd�|jjd|d�tjdkrFd}nd}ddd	d
ddd
g}d|d�|�|f}|jj|dd�dS)avPrune off branches that might slip into the file list as created
        by 'read_template()', but really don't belong there:
          * the build tree (typically "build")
          * the release tree itself (only an issue if we ran "sdist"
            previously with --keep-temp, or it aborted)
          * any RCS, CVS, .svn, .hg, .git, .bzr, _darcs directories
        �buildN)�prefixZwin32z/|\\�/ZRCSZCVSz\.svnz\.hgz\.gitz\.bzrZ_darcsz(^|%s)(%s)(%s).*�|r0)Zis_regex)	rfrB�get_fullnamer=Zexclude_patternZ
build_base�sys�platformr_)rrv�base_dirZsepsZvcs_dirsZvcs_ptrnrrrrLas


�zsdist.prune_file_listcCsX|��rt�d|j�dS|jjdd�}|�dd�|�tj	|j|fd|j�dS)z�Write the file list in 'self.filelist' (presumably as filled in
        by 'add_defaults()' and 'read_template()') to the manifest file
        named by 'self.manifest'.
        z5not writing to manually maintained manifest file '%s'Nrz*# file GENERATED by distutils, do NOT editzwriting manifest file '%s')
rGr
rpr2r=rd�insertZexecuterZ
write_file)rZcontentrrrrMys��zsdist.write_manifestcCs<tj�|j�sdSt|j�}z|��}W5|��X|dkS)NFz+# file GENERATED by distutils, do NOT edit
)rDrErFr2�openrqrr)r�fpZ
first_linerrrrG�s

z sdist._manifest_is_not_generatedc	CsVt�d|j�t|j��4}|D](}|��}|�d�s|s:q|j�|�qW5QRXdS)z�Read the manifest file (named by 'self.manifest') and use it to
        fill in 'self.filelist', the list of files to include in the source
        distribution.
        zreading manifest file '%s'�#N)r
rpr2r�strip�
startswithr=r)rr2rtrrrrH�szsdist.read_manifestcCs�|�|�tj|||jd�ttd�r4d}d|}nd}d|}|sPt�d�n
t�|�|D]<}tj	�
|�s|t�d|�q^tj	�||�}|j|||d	�q^|j
j�|�dS)
a�Create the directory tree that will become the source
        distribution archive.  All directories implied by the filenames in
        'files' are created under 'base_dir', and then we hard link or copy
        (if hard linking is unavailable) those files into place.
        Essentially, this duplicates the developer's source tree, but in a
        directory named after the distribution, containing only the files
        to be distributed.
        ��dry_run�linkZhardzmaking hard links in %s...Nzcopying files to %s...z)no files to distribute -- empty manifest?z#'%s' not a regular file -- skipping)r�)ZmkpathrZcreate_treer��hasattrrDr
rrprErFr_Z	copy_filerBZmetadataZwrite_pkg_info)rr}rdr�ru�file�destrrr�make_release_tree�s 
	


zsdist.make_release_treecCs�|j��}tj�|j|�}|�||jj�g}d|j	krT|j	�
|j	�|j	�d���|j	D]:}|j
||||j|jd�}|�
|�|jj�
dd|f�qZ||_|js�tj||jd�dS)a�Create the source distribution(s).  First, we create the release
        tree with 'make_release_tree()'; then, we create all required
        archive files (according to 'self.formats') from the release tree.
        Finally, we clean up by blowing away the release tree (unless
        'self.keep_temp' is true).  The list of archive files created is
        stored so it can be retrieved later by 'get_archive_files()'.
        Ztar)r}r8r9r�r�N)rBrzrDrEr_r6r�r=rdrr�pop�indexZmake_archiver8r9Z
dist_filesr7r5rZremove_treer�)rr}Z	base_namer7Zfmtr�rrrr?�s 




�
zsdist.make_distributioncCs|jS)zzReturn the list of archive files created when the command
        was run, or None if the command hasn't run yet.
        )r7rrrr�get_archive_files�szsdist.get_archive_files)#�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsZnegative_optZsub_commandsr\r:r;r@rCr>rJ�staticmethodr[rNrOrPrQrRrSrTrKrLrMrGrHr�r?r�rrrrr$sp�'����
(
*r)�__doc__rDr{r�warningsrZdistutils.corerZ	distutilsrrrZdistutils.text_filerZdistutils.filelistr	r
Zdistutils.utilrZdistutils.errorsrr
rrrrrr�<module>s__pycache__/build_py.cpython-38.opt-2.pyc000064400000022002150513660030014146 0ustar00U

e5d&C�@svddlZddlZddlZddlZddlmZddlTddlm	Z	m
Z
ddlmZGdd�de�Z
Gdd	�d	e
e
�ZdS)
�N)�Command)�*)�convert_path�	Mixin2to3)�logc@s�eZdZdZdddddgZddgZd	diZd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd2d'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1S)3�build_pyz5"build" pure Python modules (copy to build directory))z
build-lib=�dzdirectory to "build" (copy) to)�compile�czcompile .py to .pyc)�
no-compileNz!don't compile .py files [default])z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�force�fz2forcibly build everything (ignore file timestamps)r	r
rcCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)�	build_lib�
py_modules�package�package_data�package_dirr	�optimizer
��self�r�2/usr/lib64/python3.8/distutils/command/build_py.py�initialize_options szbuild_py.initialize_optionsc	Cs�|�ddd�|jj|_|jj|_|jj|_i|_|jjr^|jj��D]\}}t|�|j|<qF|��|_	t
|jt�s�zt|j�|_Wn t
tfk
r�td��YnXdS)NZbuild)rr)r
r
zoptimize must be 0, 1, or 2)Zset_undefined_options�distribution�packagesrrr�itemsr�get_data_files�
data_files�
isinstancer�int�
ValueError�AssertionErrorZDistutilsOptionError)r�name�pathrrr�finalize_options*s$�



zbuild_py.finalize_optionscCs:|jr|��|jr$|��|��|�|jdd��dS�Nr)�include_bytecode)r�
build_modulesr�build_packages�build_package_data�byte_compile�get_outputsrrrr�runCszbuild_py.runcs�g}|js|S|jD]h}|�|�}tjj|jg|�d��}d�|rPt|�d��fdd�|�||�D�}|�	||||f�q|S)N�.r�csg|]}|�d��qS�Nr)�.0�file�Zplenrr�
<listcomp>ssz+build_py.get_data_files.<locals>.<listcomp>)
r�get_package_dir�osr$�joinr�split�len�find_data_files�append)r�datar�src_dir�	build_dir�	filenamesrr3rras



�zbuild_py.get_data_filescsd|j�dg�|j�|g�}g�|D]:}t�tj�t�|�t|���}���fdd�|D��q$�S)N�cs$g|]}|�krtj�|�r|�qSr)r6r$�isfile)r1�fn��filesrrr4�s�z,build_py.find_data_files.<locals>.<listcomp>)	r�get�globr6r$r7�escaper�extend)rrr=Zglobs�patternZfilelistrrCrr:ys�zbuild_py.find_data_filescCs`d}|jD]P\}}}}|D]>}tj�||�}|�tj�|��|jtj�||�|dd�qq
dS)NF�Z
preserve_mode)rr6r$r7�mkpath�dirname�	copy_file)rZlastdirrr=r>r?�filename�targetrrrr*�s�zbuild_py.build_package_datacCs�|�d�}|js&|r tjj|�SdSn�g}|r�z|jd�|�}Wn*tk
rl|�d|d�|d=Yq*X|�d|�tjj|�Sq*|j�d�}|dk	r�|�d|�|r�tjj|�SdSdS)Nr.r@r���)r8rr6r$r7�KeyError�insertrE)rrr$�tailZpdirrrrr5�s(
	zbuild_py.get_package_dircCsj|dkr8tj�|�s td|��tj�|�s8td|��|rftj�|d�}tj�|�rZ|St�d|�dS)Nr@z%package directory '%s' does not existz>supposed package directory '%s' exists, but is not a directoryz__init__.pyz8package init file '%s' not found (or not a regular file))	r6r$�existsZDistutilsFileError�isdirr7rAr�warn)rrr�init_pyrrr�
check_package�s&����zbuild_py.check_packagecCs&tj�|�st�d||�dSdSdS)Nz!file %s (for module %s) not foundFT)r6r$rArrV)r�module�module_filerrr�check_module�szbuild_py.check_modulec	Cs�|�||�t�tj�t�|�d��}g}tj�|jj�}|D]P}tj�|�}||kr�tj�	tj�
|��d}|�|||f�q>|�d|�q>|S)Nz*.pyrzexcluding %s)
rXrFr6r$r7rG�abspathrZscript_name�splitext�basenamer;Zdebug_print)	rrrZmodule_files�modulesZsetup_scriptrZabs_frYrrr�find_package_modules�szbuild_py.find_package_modulesc	Cs�i}g}|jD]�}|�d�}d�|dd��}|d}z||\}}Wn"tk
rh|�|�}d}YnX|s�|�||�}	|df||<|	r�|�|d|	f�tj�||d�}
|�	||
�s�q|�|||
f�q|S)Nr.rrPr/�__init__�.py)
rr8r7rQr5rXr;r6r$r[)rrr_rYr$rZmodule_baser�checkedrWrZrrr�find_modules�s*



zbuild_py.find_modulescCsNg}|jr|�|���|jrJ|jD]$}|�|�}|�||�}|�|�q$|Sr0)rrHrdrr5r`)rr_rr�mrrr�find_all_moduless

zbuild_py.find_all_modulescCsdd�|��D�S)NcSsg|]}|d�qS)rPr)r1rYrrrr4-sz-build_py.get_source_files.<locals>.<listcomp>)rfrrrr�get_source_files,szbuild_py.get_source_filescCs$|gt|�|dg}tjj|�S)Nrb)�listr6r$r7)rr>rrYZoutfile_pathrrr�get_module_outfile/szbuild_py.get_module_outfiler/cCs�|��}g}|D]p\}}}|�d�}|�|j||�}|�|�|r|jr^|�tjj|dd��|j	dkr|�tjj||j	d��q|dd�|j
D�7}|S)Nr.r@)�optimizationrcSs,g|]$\}}}}|D]}tj�||��qqSr)r6r$r7)r1rr=r>r?rNrrrr4Bs
�z(build_py.get_outputs.<locals>.<listcomp>)rfr8rirr;r	�	importlib�util�cache_from_sourcerr)rr'r_ZoutputsrrYrZrNrrrr,3s*


�

�
�zbuild_py.get_outputscCsbt|t�r|�d�}nt|ttf�s,td��|�|j||�}tj	�
|�}|�|�|j||dd�S)Nr.z:'package' must be a string (dot-separated), list, or tuplerrJ)
r�strr8rh�tuple�	TypeErrorrirr6r$rLrKrM)rrYrZrZoutfile�dirrrr�build_moduleJs
�
zbuild_py.build_modulecCs*|��}|D]\}}}|�|||�qdSr0)rdrr)rr_rrYrZrrrr(Yszbuild_py.build_modulescCsD|jD]8}|�|�}|�||�}|D]\}}}|�|||�q$qdSr0)rr5r`rr)rrrr_Zpackage_rYrZrrrr)bs



zbuild_py.build_packagescCs�tjr|�d�dSddlm}|j}|dtjkr>|tj}|jrZ||d|j	||j
d�|jdkr||||j|j	||j
d�dS)Nz%byte-compiling is disabled, skipping.r)r+rP)rr
�prefix�dry_run)�sys�dont_write_bytecoderV�distutils.utilr+rr6�sepr	r
rtr)rrDr+rsrrrr+vs&

�
�zbuild_py.byte_compileN)r/)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optrr%r-rr:r*r5rXr[r`rdrfrgrir,rrr(r)r+rrrrrs8�



'4
	rc@seZdZdd�Zdd�ZdS)�
build_py_2to3cCsLg|_|jr|��|jr*|��|��|�|j�|�|jdd��dSr&)	�
updated_filesrr(rr)r*Zrun_2to3r+r,rrrrr-�szbuild_py_2to3.runcCs,t�||||�}|dr(|j�|d�|S)Nr/r)rrrr}r;)rrYrZr�resrrrrr�szbuild_py_2to3.build_moduleN)ryrzr{r-rrrrrrr|�sr|)r6�importlib.utilrkrurFZdistutils.corerZdistutils.errorsrwrrZ	distutilsrrr|rrrr�<module>s}__pycache__/config.cpython-38.opt-2.pyc000064400000015355150513660040013622 0ustar00U

e5d=3�@shddlZddlZddlmZddlmZddlmZddlm	Z	ddd�Z
Gd	d
�d
e�Zd
dd�ZdS)�N)�Command)�DistutilsExecError)�customize_compiler)�logz.cz.cxx)�czc++c	@s�eZdZdZdddddddd	d
g	Zdd�Zd
d�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
d0dd �Zd1d!d"�Zd2d#d$�Zd3d%d&�Zd4d'd(�Zd5d*d+�Zdddgfd,d-�Zd6d.d/�ZdS)7�configzprepare to build)z	compiler=Nzspecify the compiler type)zcc=Nzspecify the compiler executable)z
include-dirs=�Iz.list of directories to search for header files)zdefine=�DzC preprocessor macros to define)zundef=�Uz!C preprocessor macros to undefine)z
libraries=�lz!external C libraries to link with)z
library-dirs=�Lz.directories to search for external C libraries)�noisyNz1show every action (compile, link, run, ...) taken)zdump-sourceNz=dump generated source files before attempting to compile themcCs4d|_d|_d|_d|_d|_d|_d|_g|_dS)N�)�compilerZcc�include_dirs�	libraries�library_dirsr
�dump_source�
temp_files��self�r�0/usr/lib64/python3.8/distutils/command/config.py�initialize_options3szconfig.initialize_optionscCs�|jdkr|jjpg|_nt|jt�r6|j�tj�|_|jdkrHg|_nt|jt�r^|jg|_|jdkrpg|_nt|jt�r�|j�tj�|_dS�N)	rZdistribution�
isinstance�str�split�os�pathseprrrrrr�finalize_optionsBs



zconfig.finalize_optionscCsdSrrrrrr�runRsz
config.runcCszddlm}m}t|j|�sv||j|jdd�|_t|j�|jrN|j�|j�|j	rb|j�
|j	�|jrv|j�|j�dS)Nr)�	CCompiler�new_compilerr)r�dry_runZforce)
�distutils.ccompilerr"r#rrr$rrZset_include_dirsrZ
set_librariesrZset_library_dirs)rr"r#rrr�_check_compilerYs�
zconfig._check_compilerc	Csldt|}t|d��L}|r>|D]}|�d|�q |�d�|�|�|ddkr^|�d�W5QRX|S)NZ_configtest�wz#include <%s>
�
���)�LANG_EXT�open�write)r�body�headers�lang�filename�file�headerrrr�_gen_temp_sourcefileks

zconfig._gen_temp_sourcefilecCs<|�|||�}d}|j�||g�|jj|||d�||fS)Nz
_configtest.i�r)r3r�extendrZ
preprocess)rr-r.rr/�src�outrrr�_preprocessws
zconfig._preprocesscCs\|�|||�}|jr"t|d|�|j�|g�\}|j�||g�|jj|g|d�||fS)Nzcompiling '%s':r4)r3r�	dump_filerZobject_filenamesrr5�compile)rr-r.rr/r6�objrrr�_compile~szconfig._compilec
Csr|�||||�\}}tj�tj�|��d}	|jj|g|	|||d�|jjdk	r\|	|jj}	|j�	|	�|||	fS)Nr)rrZtarget_lang)
r<r�path�splitext�basenamerZlink_executableZ
exe_extensionr�append)
rr-r.rrrr/r6r;�progrrr�_link�s�zconfig._linkc	GsT|s|j}g|_t�dd�|��|D](}zt�|�Wq&tk
rLYq&Xq&dS)Nzremoving: %s� )rr�info�joinr�remove�OSError)r�	filenamesr0rrr�_clean�sz
config._cleanNrcCsRddlm}|��d}z|�||||�Wn|k
rDd}YnX|��|S)Nr��CompileErrorTF)r%rKr&r8rI�rr-r.rr/rK�okrrr�try_cpp�s
zconfig.try_cppc	Csx|��|�||||�\}}t|t�r0t�|�}t|��.}d}	|��}
|
dkrPqb|�|
�r>d}	qbq>W5QRX|�	�|	S)NF�T)
r&r8rr�rer:r+�readline�searchrI)r�patternr-r.rr/r6r7r1�match�linerrr�
search_cpp�s	



zconfig.search_cppcCsdddlm}|��z|�||||�d}Wn|k
rDd}YnXt�|rRdpTd�|��|S)NrrJTF�success!�failure.)r%rKr&r<rrDrIrLrrr�try_compile�s
zconfig.try_compilec
	Cspddlm}m}|��z|�||||||�d}	Wn||fk
rPd}	YnXt�|	r^dp`d�|��|	S�Nr)rK�	LinkErrorTFrWrX)r%rKr[r&rBrrDrI)
rr-r.rrrr/rKr[rMrrr�try_link�s
�
zconfig.try_linkc

Cs�ddlm}m}|��z.|�||||||�\}	}
}|�|g�d}Wn||tfk
rdd}YnXt�|rrdptd�|�	�|SrZ)
r%rKr[r&rBZspawnrrrDrI)
rr-r.rrrr/rKr[r6r;ZexerMrrr�try_run�s
�

zconfig.try_runrc	Cst|��g}|r|�d|�|�d�|r<|�d|�n|�d|�|�d�d�|�d}|�|||||�S)Nz
int %s ();z
int main () {z  %s();z  %s;�}r()r&r@rEr\)	r�funcr.rrrZdeclZcallr-rrr�
check_funcs


�zconfig.check_funccCs |��|�d|||g||�S)Nzint main (void) { })r&r\)rZlibraryrr.rZother_librariesrrr�	check_lib4s


�zconfig.check_libcCs|jd|g|d�S)Nz
/* No body */)r-r.r)rN)rr2rrr/rrr�check_headerBs
�zconfig.check_header)NNNr)NNNr)NNr)NNNNr)NNNNr)NNNNrr)NNr)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsrr r!r&r3r8r<rBrIrNrVrYr\r]r`rarbrrrrrs\�	
�

�
�
�
�
�rcCsJ|dkrt�d|�n
t�|�t|�}zt�|���W5|��XdS)Nz%s)rrDr+�close�read)r0�headr1rrrr9Ks
r9)N)
rrPZdistutils.corerZdistutils.errorsrZdistutils.sysconfigrZ	distutilsrr*rr9rrrr�<module>s
8__pycache__/bdist_wininst.cpython-38.pyc000064400000020453150513660040014270 0ustar00U

e5d�>�@sxdZddlZddlZddlZddlmZddlmZddlm	Z	m
Z
ddlTddlm
Z
ddlmZGd	d
�d
e�ZdS)zzdistutils.command.bdist_wininst

Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program.�N)�Command)�get_platform)�create_tree�remove_tree)�*)�get_python_version)�logc
s�eZdZdZdddde�fdddd	d
ddd
dddg
ZddddgZejdkZ	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zd'd!d"�Zd#d$�Zd%d&�Z�ZS)(�
bdist_wininstz-create an executable installer for MS Windows)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)�no-target-compile�cz/do not compile .py to .pyc on the target system)�no-target-optimize�oz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=�dz-directory to put final built distributions in)zbitmap=�bz>bitmap to use for the installer instead of python-powered logo)ztitle=�tz?title to display on the installer background instead of default)�
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distribution)zuser-access-control=Nz�specify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UACrr
rr�win32cs t�j||�t�dtd�dS)Nz^bdist_wininst command is deprecated since Python 3.8, use bdist_wheel (wheel packages) instead�)�super�__init__�warnings�warn�DeprecationWarning)�self�args�kw��	__class__��7/usr/lib64/python3.8/distutils/command/bdist_wininst.pyr?s
�zbdist_wininst.__init__cCsRd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_dS)Nr)
�	bdist_dir�	plat_name�	keep_temp�no_target_compile�no_target_optimize�target_version�dist_dir�bitmap�title�
skip_build�install_script�pre_install_script�user_access_control)rr!r!r"�initialize_optionsEsz bdist_wininst.initialize_optionscCs�|�dd�|jdkrR|jr6|jr6|j�d�}|j|_|�d�j}tj	�
|d�|_|js^d|_|js�|j��r�t
�}|jr�|j|kr�td|f��||_|�ddd�|jr�|jjD]}|jtj	�|�kr�q�q�td|j��dS)	N�bdist)r,r,Zwininst�zMtarget version can only be %s, or the '--skip-build' option must be specified)r)r))r$r$z(install_script '%s' not found in scripts)Zset_undefined_optionsr#r,r$�distributionZget_command_obj�get_finalized_command�
bdist_base�os�path�joinr(�has_ext_modulesrZDistutilsOptionErrorr-�scripts�basename)rr1r5Z
short_version�scriptr!r!r"�finalize_optionsUs>
�����zbdist_wininst.finalize_optionsc
Cs�tjdkr&|j��s|j��r&td��|js6|�d�|jddd�}|j	|_
|j|_d|_|j|_|�d�}d|_
d|_|j��r�|j}|s�|js�td	��d
tjdd�}d|j|f}|�d�}tj�|jd
|�|_dD],}|��}|dkr�|d}t|d||�q�t�d|j	�|��tj�dtj�|j	d��|��tjd=ddlm }|�}	|j�!�}
|j"|	d|j	d�}|�#||
|j$�|j���r�t%�}nd}|jj&�'d||�(|
�f�t�)d|�t�*|�|j+�s�t,|j	|j-d�dS)Nrz^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platform�build�install�)Zreinit_subcommandsr�install_libz Should have already checked thisz%d.%drz.%s-%s�lib)ZpurelibZplatlib�headersr:�datarCz/Include/$dist_nameZinstall_zinstalling to %sZPURELIB)�mktemp�zip)Zroot_dir�anyr	zremoving temporary file '%s')�dry_run).�sys�platformr3r9Zhas_c_librariesZDistutilsPlatformErrorr,Zrun_commandZreinitialize_commandr#�rootZwarn_dirr$�compile�optimizer(�AssertionError�version_infor4r6r7r8Z
build_baseZ	build_lib�upper�setattrr�infoZensure_finalized�insert�runZtempfilerE�get_fullnameZmake_archive�
create_exer*rZ
dist_files�append�get_installer_filename�debug�remover%rrH)
rr?rAr(Zplat_specifierr>�key�valuerEZarchive_basename�fullname�arcnameZ	pyversionr!r!r"rT{st
���




��
��
zbdist_wininst.runcCsZg}|jj}|�d�|jpdd}dd�}dD]B}t||d�}|r0|d|��||�f}|�d|||�f�q0|�d	�|jr�|�d
|j�|�d||��|�d|j�|�d
|j�|j	r�|�d|j	�|j
r�|�d|j
�|j�p|j��}|�d||��ddl
}ddl}	d|�|�
��|	jf}
|�d|
�d�|�S)Nz
[metadata]r2�
cSs|�dd�S)Nr_z\n)�replace)�sr!r!r"�escape�sz)bdist_wininst.get_inidata.<locals>.escape)ZauthorZauthor_email�descriptionZ
maintainerZmaintainer_email�nameZurl�versionz
    %s: %sz%s=%sz
[Setup]zinstall_script=%szinfo=%sztarget_compile=%dztarget_optimize=%dztarget_version=%szuser_access_control=%sztitle=%srzBuilt %s with distutils-%sz
build_info=%s)r3�metadatarWZlong_description�getattr�
capitalizer-r&r'r(r/r+rU�time�	distutils�ctime�__version__r8)r�linesrfrRrbrdrDr+rirjZ
build_infor!r!r"�get_inidata�s>
�
�zbdist_wininst.get_inidataNc
CsHddl}|�|j�|��}|�|�}|�d|�|r`t|d��}|��}W5QRXt|�}	nd}	t|d���}
|
�	|�
��|r�|
�	|�t|t�r�|�
d�}|d}|jr�t|jddd	��}|���
d�}W5QRX||d
}n|d}|
�	|�|�ddt|�|	�}
|
�	|
�t|d��}|
�	|���W5QRXW5QRXdS)
Nrzcreating %s�rb�wb�mbcs��rzlatin-1)�encodings
z<iiii{V4)�structZmkpathr)rnrXZannounce�open�read�len�write�
get_exe_bytes�
isinstance�str�encoder.Zpack)rr^r]r*ruZcfgdata�installer_name�fZ
bitmapdataZ	bitmaplen�filer<Zscript_data�headerr!r!r"rV�sD




�
�
zbdist_wininst.create_execCsD|jr&tj�|jd||j|jf�}ntj�|jd||jf�}|S)Nz%s.%s-py%s.exez	%s.%s.exe)r(r6r7r8r)r$)rr]r~r!r!r"rX1s
��
�z$bdist_wininst.get_installer_filenamec	Cs$t�}|jrl|j|krl|jdkr&d}q�|jdkr6d}q�|jdkrFd}q�|jdkrVd}q�|jdkrfd	}q�d
}n@zddlm}Wntk
r�d
}YnX|�d
�d}|d}tj�t	�}|j
dkr�|j
dd�dkr�|j
dd�}nd}tj�|d||f�}t|d�}z|��W�S|�
�XdS)Nz2.4z6.0z7.1z2.5z8.0z3.2z9.0z3.4z10.0z14.0r)�CRT_ASSEMBLY_VERSION�.z.0r��winr2zwininst-%s%s.exero)rr(Zmsvcrtr��ImportError�	partitionr6r7�dirname�__file__r$r8rv�closerw)	rZcur_versionZbvr��majorZ	directoryZsfix�filenamerr!r!r"rz>s8	






zbdist_wininst.get_exe_bytes)N)�__name__�
__module__�__qualname__rcrZuser_optionsZboolean_optionsrIrJZ_unsupportedrr0r=rTrnrVrXrz�
__classcell__r!r!rr"r	s>���%�
&Q.
7
r	)�__doc__r6rIrZdistutils.corerZdistutils.utilrZdistutils.dir_utilrrZdistutils.errorsZdistutils.sysconfigrrjrr	r!r!r!r"�<module>s__pycache__/bdist_msi.cpython-38.opt-2.pyc000064400000043114150513660040014324 0ustar00U

e5d߉�@s�ddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZddlZdd	lmZmZmZdd
lmZmZmZmZGdd�de�ZGd
d�de�ZdS)�N)�Command)�remove_tree)�get_python_version)�
StrictVersion)�DistutilsOptionError)�get_platform)�log)�schema�sequence�text)�	Directory�Feature�Dialog�add_datac@sBeZdZdd�Zdd�Zddd�Zdd
d�Zdd
d�Zdd�ZdS)�PyDialogcOs>tj|f|��|jd}d|d}|�dd||jd�dS)N�$�iHZ
BottomLiner)r�__init__�h�line�w)�self�args�kwZrulerZbmwidth�r�3/usr/lib64/python3.8/distutils/command/bdist_msi.pyrs
zPyDialog.__init__c
Cs|�ddddddd|�dS)N�Title��
�@�<�z{\VerdanaBold10}%s)r)r�titlerrrr"#s�zPyDialog.title�Back�c
Cs,|r
d}nd}|�|d|jddd|||�S)N�r$���8���
pushbuttonr�rr"�next�name�active�flagsrrr�back*sz
PyDialog.back�Cancelc
Cs,|r
d}nd}|�|d|jddd|||�S)Nr%r$i0r'r(r)r*r,rrr�cancel5szPyDialog.cancel�Nextc
Cs,|r
d}nd}|�|d|jddd|||�S)Nr%r$��r'r(r)r*r,rrrr-@sz
PyDialog.nextc
Cs,|�|t|j|d�|jdddd||�S)N�r'r(r)r%)r+�intrr)rr.r"r-Zxposrrr�xbuttonKszPyDialog.xbuttonN)r#r$)r2r$)r4r$)	�__name__�
__module__�__qualname__rr"r1r3r-r8rrrrrs



rc@s�eZdZdZdddde�fdddd	d
ddd
g
ZddddgZddddddddddddddd d!d"d#d$d%gZd&Zd'd(�Z	d)d*�Z
d+d,�Zd-d.�Zd/d0�Z
d1d2�Zd3d4�Zd5d6�Zd7S)8�	bdist_msiz7create a Microsoft Installer (.msi) binary distribution)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)�no-target-compile�cz/do not compile .py to .pyc on the target system)�no-target-optimize�oz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=�dz-directory to put final built distributions in)�
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distributionr>r@rBrEz2.0z2.1z2.2z2.3z2.4z2.5z2.6z2.7z2.8z2.9z3.0z3.1z3.2z3.3z3.4z3.5z3.6z3.7z3.8z3.9�XcCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)Nr)�	bdist_dir�	plat_name�	keep_tempZno_target_compileZno_target_optimize�target_version�dist_dir�
skip_build�install_script�pre_install_script�versions)rrrr�initialize_options}szbdist_msi.initialize_optionscCs�|�dd�|jdkr2|�d�j}tj�|d�|_t�}|jsN|j	�
�rN||_|jr�|jg|_|js�|j	�
�r�|j|kr�t
d|f��nt|j�|_|�ddd�|jr�t
d��|jr�|j	jD]}|jtj�|�kr�q�q�t
d|j��d|_dS)	NZbdist)rLrLZmsizMtarget version can only be %s, or the '--skip-build' option must be specified)rKrK)rHrHz5the pre-install-script feature is not yet implementedz(install_script '%s' not found in scripts)Zset_undefined_optionsrG�get_finalized_command�
bdist_base�os�path�joinrrJ�distribution�has_ext_modulesrOrLr�list�all_versionsrNrMZscripts�basename�install_script_key)rrRZ
short_versionZscriptrrr�finalize_options�sH

�������zbdist_msi.finalize_optionscCsz|js|�d�|jddd�}|j|_|j|_d|_|�d�}d|_d|_|j�	�r�|j
}|spdtjdd�}d	|j
|f}|�d�}tj�|jd
|�|_t�d|j�|��tj�dtj�|jd��|��tjd=|�|j�|j��}|�|�}tj�|�}tj�|��r"t�|�|jj }|j!}	|	�s<|j"}	|	�sFd
}	|�#�}
dt$|
�j%}|j��}|j
�r~d|j
|f}nd|}t&�'|t(|t&�)�||	�|_*t&�+|j*t,�d|
fg}
|j-�p�|j.}|�r�|
�/d|f�|j0�r�|
�/d|j0f�|
�rt1|j*d|
�|�2�|�3�|�4�|�5�|j*�6�t7|jd��r^d|j
�pJd|f}|jj8�/|�|j9�svt:|j|j;d�dS)N�build�installr$)Zreinit_subcommandsr�install_libz%d.%d�z.%s-%s�libzinstalling to %sZPURELIBZUNKNOWNz%d.%d.%dzPython %s %sz	Python %sZDistVersionZ
ARPCONTACTZARPURLINFOABOUT�Property�
dist_filesr<�any)�dry_run)<rLZrun_commandZreinitialize_commandrG�prefixZwarn_dir�compile�optimizerVrWrJ�sys�version_inforHrQrSrTrUZ
build_baseZ	build_libr�infoZensure_finalized�insert�runZmkpathrK�get_fullname�get_installer_filename�abspath�exists�unlink�metadata�authorZ
maintainerZget_versionr�version�msilibZ
init_databaser	Zgen_uuid�dbZ
add_tablesr
Zauthor_emailZmaintainer_email�appendZurlr�add_find_python�	add_files�add_scripts�add_ui�Commit�hasattrrcrIrre)rr^r_rJZplat_specifierr]�fullname�installer_namersrtruZsversionZproduct_nameZpropsZemail�tuprrrrm�s�




�



�

z
bdist_msi.runc
Cs|j}t�d�}tj�|j�}t||d|dd�}t|ddddddd�}||d	fg}|j	|j
gD]t}d|}d|}	}
d}||j
kr�d
}d}
nd|}d}
t||	||d|
|d�}t||||||
�}|�|||f�q`|��i}|D�]\}}}|g}|�r�|�
�}t�|j�D]�}tj�|j|�}tj�|��rld
|�|�|f}||}
t|||||
|�}|�|�n�|j�s�|�|j|d�||k�r�|�|�}||<||jk�r�|j�r�td|��d||_n*||}t|jd|||j|d|jfg��qq�|��q�|�|�dS)NZ	distfiles�	TARGETDIRZ	SourceDir�PythonZ
Everythingrr$)Z	directory�zPython from another locationr`zPython %s from registryz%s|%szMultiple files with name %sz[#%s]Z
DuplicateFile)rwrvZCABrSrTrprGrr
rO�
other_versionrxr}�pop�listdirZabsoluterU�isdirZ
make_shortZ	componentZstart_componentZlogicalZadd_filerMr[rrZcommit)rrwZcabZrootdir�root�f�itemsru�targetr.�defaultZdescr"�level�dir�seenZfeatureZtodo�fileZafileZshortZnewdir�keyrrrrz
sf

�

��

zbdist_msi.add_filescCs|d}|jD�]j}d|}d|}d|}d|}d|}d|}d|}	d	|}
d
|}d|}tjrld}
nd
}
t|jd|d
|d|
f|d|d|
fg�t|jd||f||fg�t|jd|d|d|df|	d|d|df|
d|d|dfg�t|jd|||f|	||df|
d|d
fg�t|jd|||f|	||df|
d|d
fg�t|jdd|dd|fg�|d7}q
dS)Ni�z)SOFTWARE\Python\PythonCore\%s\InstallPathzpython.machine.zpython.user.zPYTHON.MACHINE.zPYTHON.USER.ZPythonFromMachineZPythonFromUserZ	PythonExer��PYTHON�r`Z
RegLocatorr$Z	AppSearch�CustomActioni3�[�]z]\python.exe�InstallExecuteSequence�InstallUISequenceZ	Conditionr�rz
NOT TARGETDIR�)rOrvZWin64rrw)r�start�verZinstall_pathZmachine_regZuser_regZmachine_propZ	user_propZmachine_actionZuser_actionZ
exe_actionZtarget_dir_prop�exe_propZTyperrrryCs`�����������zbdist_msi.add_find_pythonc
Cs|jrjd}|j|jgD]P}d|}d|}t|jd|d||jfg�t|jd|d||fg�|d7}q|jr�tj�	|j
d	�}t|d
��4}|�d�t|j��}|�|�
��W5QRXW5QRXt|jdd
t�|�fg�t|jddg�t|jddg�dS)Ni�zinstall_script.r�r��2r�z&Python%s=3r$zpreinstall.batrzrem ="""
%1 %0
exit
"""
�Binary�
PreInstall)r�r`r�N)r�z
NOT Installedi�)rMrOr�rrwr[rNrSrTrUrG�open�write�readrvr�)rr�r�Zinstall_actionr�Zscriptfnr�Zfinrrrr{ys6��
	
"���zbdist_msi.add_scriptscCs�
|j}d}}d}d}d}d}d}d}	t|dd	d
ddd
dg�t|dddddg�t|ddddddg�t|dtj�t|dtj�t|d||||||ddd�}
|
�d�|
jddd d!�|
jd"d#d d!�|
�d$d%d&d'd(d)d*�|
�d+d%d,d'd-d)d.�|
j	dd"dd/�}|�
d0d1�t|d2||||||ddd�}|�d3�|jddd d!�|jd"d#d d!�|�d$d%d&d'd(d)d4�|�d+d%d,d'd-d)d.�|j	dd"dd/�}|�
d0d1�t|d5||||||ddd�}
|
�d6�|
jddd d!�|
jd"d#d d!�|
�d7d%d8d'd-d)d.�|
j	dd"dd/�}|�
d0d9�t|d:||||d;|d<d<d<d=d>�}|�d?d%d@dAd%d)dB�|�d7d-dCdDd-d)dE�|�dFd-dGdHdddI�|�dJdKd-dLdHdMdNdOddd�|jd1dPd1d/�}|�
d0d1�|j	dPd<dPd/�}|�
d0dP�|jd<d1d<d/�}|�
d0d<�t|dQddRdHdSdT|dUdd�}|�dUddVdDdWddX�|�
dYdZd[d\d]dd^d��
d0d_�|�
d`dad[d\d]ddbd��
d0dc�|�
ddd d[d\d]dded��
d0df�|�
dgdhd[d\d]dd"d��
d0di�|�
djd\d[d\d]ddPd��
d0dk�|�
dldmd[d\d]ddnd��
d0do�|�
dpdqd[d\d]dd<d��
d0dr�t|dsddRdtdud|d^d^d^�}|�dFdWd%dvdwddx�|�
dbd[dydzd{ddbd^�}|�
d0d1�|�
d^d|dydzd{dd^db�}|�
d0d9�t|d}ddRdtdu||d9d9d9�}|�dFdWd%dvdwdd~�|�
d9ddydzd{dd9d�}|�
d0d1�t|d�||||||d"d"d"�}|�d7d%d&d'd�d)d��|�d��|�dd%d�d'd-d)d��}|�ddF�|�d�d%d�d'dwd)d�}|�d�dF�|jd#dd d!�|j	d�dd d!�|�d"d�}|�
d�ds�t|d�||||||d�d�d"�}|�d��|�d�d%dwdd-dd�|j���|jddd d!�|�	d�d"�}d}|j
d�d�|d��|j|jgD](}|d7}|j
d�d�|d�||d���q
|j
d�d}|dd��|j
d0d9|d�d��|�d"d��}|�
d�ds�|�d�d�d%d�ddZdd�dd�d�}|�
d�d��|j}d�|}d�|}|�d�d%dAdd%dd��}|�d�|�|�d�|�|�d�|�|�d�|�|�d�d�d%d�dd�dd�|dd�d�}|�d�|�|�d�|�|�d�|�|�d�|�t|d�||||||d�d�d�d=d>�}|�d?d%d@dAd%d)d��|�d7d-d-dDd-d)d��|�dFd-d�dHd�dd��|�d�d�d-d�dHd�d�dd�dd�|�d�dndd���
d0d9�t|d�||||||d�d�d"�}|�d��|�d�d%d�dtddd�dXd��	}|�d�d d�d�d-d��|�d�d d�d�d-d��|jd#dd d!�|�	d�d"�}|�
d�d�d�d�|j
d0d9d�d��|�d"d��}|�
d�ds�t|d�||||||d"d"d"d=d>�}|�d?d-d%dAd%d)d��|�dFd�d�ddwddġ|�d�d�d�d�d-ddơ|�dd&d�|d&d-dd��}|�ddF�|�d�d�d�dZddRd�dd�dd�}|�d�dˡ|jdd�d=d!�|j	d�d"d=d!�|�d"d#��
d�ds�t|d�||||||d�d�d"�}|�d͡|�d�d%d�dHdhddС|�d�d%d�dHd�dd�dXd��	}|�d�d d�dAd{d֡|�d�d d�dAd{d١|jddd=d!�|�	dd"�}|�
d�d�d�d��|�
d�d�d�d@�|�
d�d�d�dN�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d0d9d�d-�|�d"dѡ�
d�ds�dS)�Nr�iri,z[ProductName] Setupr%r$� rb)Z
DefaultUIFont�DlgFont8)ZErrorDialog�ErrorDlg)Z	Progress1ZInstall)Z	Progress2Zinstalls)�MaintenanceForm_Action�Repair)�
WhichUsers�ALLZ	TextStyle)r��Tahoma�	Nr)ZDlgFontBold8r��Nr$)Z
VerdanaBold10�VerdanarNr$)ZVerdanaRed9r�r��rr�)�
PrepareDlgz(Not Privileged or Windows9x or Installed�)�
WhichUsersDlgz.Privileged and not Windows9x and not Installed�)�SelectFeaturesDlgz
Not Installedi�)�MaintenanceTypeDlgz,Installed AND NOT RESUME AND NOT Preselectedi�)�ProgressDlgNi�
ActionText�UITextZ
FatalErrorZFinishz)[ProductName] Installer ended prematurelyz< Backr)r/r2r#ZDescription1r�Fr�Pr!z�[ProductName] setup ended prematurely because of an error.  Your system has not been modified.  To install this program at a later time, please run the installation again.ZDescription2��z.Click the Finish button to exit the Installer.)r.Z	EndDialogZExitZUserExitz'[ProductName] Installer was interruptedz�[ProductName] setup was interrupted.  Your system has not been modified.  To install this program at a later time, please run the installation again.Z
ExitDialogz&Completing the [ProductName] InstallerZDescription��ZReturnZ
FilesInUse�ZRetryF)Zbitmapr���z{\DlgFontBold8}Files in Use�iz8Some files that need to be updated are currently in use.ZText�7iJz�The following applications are using files that need to be updated by this setup. Close these applications and then click Retry to continue the installation or Cancel to exit it.ZListZListBox�k��ZFileInUseProcess�Ignorer�r�eiZ	ErrorTextr��0r��N�x�H�Q�ZNoZErrorNo�Y��ZYesZErrorYes�AZAbortZ
ErrorAbort�C�*ZErrorCancel�IZErrorIgnore�O�ZOkZErrorOk�R��Z
ErrorRetryZ	CancelDlgi�U���z;Are you sure you want to cancel [ProductName] installation?�9r(r)�ZWaitForCostingDlgzRPlease wait while the installer finishes determining your disk space requirements.�fr��(zOPlease wait while the Installer prepares to guide you through the installation.z&Welcome to the [ProductName] Installer�nzPondering...Z
ActionData�r4ZSpawnDialogr�zSelect Python InstallationsZHintz9Select the Python locations where %s should be installed.zNext >z[TARGETDIR]z[SourceDir])Zorderingz
[TARGETDIR%s]z FEATURE_SELECTED AND &Python%s=3ZSpawnWaitDialogr`ZFeaturesZ
SelectionTreer ZFEATUREZPathEditz[FEATURE_SELECTED]�1z!FEATURE_SELECTED AND &Python%s<>3ZOtherz$Provide an alternate Python locationZEnableZShowZDisableZHide���r�ZDiskCostDlgZOKz&{\DlgFontBold8}Disk Space RequirementszFThe disk space required for the installation of the selected features.�5aThe highlighted volumes (if any) do not have enough disk space available for the currently selected features.  You can either remove some files from the highlighted volumes, or choose to install less features onto local drive(s), or select different destination drive(s).Z
VolumeListZVolumeCostList�d�iz{120}{70}{70}{70}{70}g�?r�ZAdminInstallzGSelect whether to install [ProductName] for all users of this computer.r�r��zInstall for all usersZJUSTME�zInstall just for mez
[ALLUSERS]zWhichUsers="ALL"r�z({\DlgFontBold8}[Progress1] [ProductName]�#�AzYPlease wait while the Installer [Progress2] [ProductName]. This may take several minutes.ZStatusLabelzStatus:ZProgressBariz
Progress doneZSetProgressZProgressr�z)Welcome to the [ProductName] Setup WizardZBodyText�?z:Select whether you want to repair or remove [ProductName].ZRepairRadioGroup�lr�r�r�z&Repair [ProductName]ZRemoverzRe&move [ProductName]z[REINSTALL]zMaintenanceForm_Action="Repair"z[Progress1]Z	Repairingz[Progress2]ZrepairsZ	Reinstallr�z[REMOVE]zMaintenanceForm_Action="Remove"�ZRemoving�Zremoves�
�z MaintenanceForm_Action<>"Change")rwrrr�r�rr"r1r3r-ZeventZcontrolrr+�mappingrVrnrOr�Z	conditionr8Z
radiogroup�add)rrw�x�yrrr"ZmodalZmodelessZtrack_disk_spaceZfatalrAZ	user_exitZexit_dialogZinuse�errorr3ZcostingZprepZseldlg�orderrur�Zinstall_other_condZdont_install_other_condZcostZ
whichusers�gZprogressZmaintrrrr|�sv��
��	��
�
���
���
�������       ������
�
���
��������
�
������
��zbdist_msi.add_uicCs<|jrd||j|jf}nd||jf}tj�|j|�}|S)Nz%s.%s-py%s.msiz	%s.%s.msi)rJrHrSrTrUrK)rrZ	base_namer�rrrro�s�z bdist_msi.get_installer_filenameN)r9r:r;ZdescriptionrZuser_optionsZboolean_optionsrYr�rPr\rmrzryr{r|rorrrrr<Ss^����
�
([66&@r<)rirSZdistutils.corerZdistutils.dir_utilrZdistutils.sysconfigrZdistutils.versionrZdistutils.errorsrZdistutils.utilrZ	distutilsrrvr	r
rrr
rrrr<rrrr�<module>	s>__pycache__/install_egg_info.cpython-38.pyc000064400000005666150513660040014724 0ustar00U

e5d+
�@sddZddlmZddlmZmZddlZddlZddlZGdd�de�Z	dd�Z
d	d
�Zdd�ZdS)
z�distutils.command.install_egg_info

Implements the Distutils 'install_egg_info' command, for installing
a package's PKG-INFO metadata.�)�Command)�log�dir_utilNc@s:eZdZdZdZdgZdd�Zdd�Zdd	�Zd
d�Z	dS)
�install_egg_infoz)Install an .egg-info file for the packagez8Install package's PKG-INFO metadata as an .egg-info file)zinstall-dir=�dzdirectory to install tocCs
d|_dS�N)�install_dir��self�r�:/usr/lib64/python3.8/distutils/command/install_egg_info.py�initialize_optionssz#install_egg_info.initialize_optionscCsb|�dd�dtt|j����tt|j����ftjdd��}t	j
�|j|�|_
|j
g|_dS)NZinstall_lib)rrz%s-%s-py%d.%d.egg-info�)Zset_undefined_options�to_filename�	safe_name�distributionZget_name�safe_versionZget_version�sys�version_info�os�path�joinr�target�outputs)r
�basenamerrr�finalize_optionss��z!install_egg_info.finalize_optionsc	Cs�|j}tj�|�r0tj�|�s0tj||jd�nNtj�|�rV|�	tj
|jfd|�n(tj�|j�s~|�	tj|jfd|j�t
�d|�|js�t|ddd��}|jj�|�W5QRXdS)N)�dry_runz	Removing z	Creating z
Writing %s�wzUTF-8)�encoding)rrr�isdir�islinkrZremove_treer�existsZexecute�unlinkr�makedirsr�info�openrZmetadataZwrite_pkg_file)r
r�frrr�run s�zinstall_egg_info.runcCs|jSr)rr	rrr�get_outputs.szinstall_egg_info.get_outputsN)
�__name__�
__module__�__qualname__�__doc__ZdescriptionZuser_optionsr
rr'r(rrrrrs�
rcCst�dd|�S)z�Convert an arbitrary string to a standard distribution name

    Any runs of non-alphanumeric/. characters are replaced with a single '-'.
    �[^A-Za-z0-9.]+�-)�re�sub��namerrrr6srcCs|�dd�}t�dd|�S)z�Convert an arbitrary string to a standard version string

    Spaces become dots, and all other non-alphanumeric characters become
    dashes, with runs of multiple dashes condensed to a single dash.
    � �.r-r.)�replacer/r0)�versionrrrr>srcCs|�dd�S)z|Convert a project or version name to its filename-escaped form

    Any '-' characters are currently replaced with '_'.
    r.�_)r5r1rrrrHsr)
r,Z
distutils.cmdrZ	distutilsrrrrr/rrrrrrrr�<module>s+
__pycache__/bdist_dumb.cpython-38.pyc000064400000007012150513660040013520 0ustar00U

e5d1�@shdZddlZddlmZddlmZddlmZmZddl	Tddl
mZddlm
Z
Gd	d
�d
e�ZdS)z�distutils.command.bdist_dumb

Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix).�N)�Command)�get_platform)�remove_tree�ensure_relative)�*)�get_python_version)�logc	@s^eZdZdZdddde�fdddd	d
ddg	Zd
ddgZddd�Zdd�Zdd�Z	dd�Z
dS)�
bdist_dumbz"create a "dumb" built distribution)z
bdist-dir=�dz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))zformat=�fz>archive format to create (tar, gztar, bztar, xztar, ztar, zip))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)z	dist-dir=r
z-directory to put final built distributions in)�
skip-buildNz2skip rebuilding everything (for testing/debugging))�relativeNz7build the archive using relative paths (default: false))zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]r
rrZgztar�zip)�posix�ntcCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	�	bdist_dir�	plat_name�format�	keep_temp�dist_dir�
skip_buildr�owner�group)�self�r�4/usr/lib64/python3.8/distutils/command/bdist_dumb.py�initialize_options2szbdist_dumb.initialize_optionscCsz|jdkr&|�d�j}tj�|d�|_|jdkrfz|jtj|_Wn"t	k
rdt
dtj��YnX|�dddd�dS)NZbdistZdumbz@don't know how to create dumb built distributions on platform %s)rr)rr)rr)rZget_finalized_command�
bdist_base�os�path�joinr�default_format�name�KeyError�DistutilsPlatformErrorZset_undefined_options)rr"rrr �finalize_options=s"

��
�zbdist_dumb.finalize_optionscCs(|js|�d�|jddd�}|j|_|j|_d|_t�d|j�|�d�d|j�	�|j
f}tj�
|j|�}|js~|j}nJ|j��r�|j|jkr�tdt|j�t|j�f��ntj�
|jt|j��}|j||j||j|jd	�}|j��r�t�}nd
}|jj�d||f�|j�s$t|j|jd�dS)
NZbuild�install�)Zreinit_subcommandsrzinstalling to %sz%s.%szScan't make a dumb built distribution where base and platbase are different (%s, %s))Zroot_dirrr�anyr	)�dry_run) rZrun_commandZreinitialize_commandr�rootZwarn_dirr�infoZdistributionZget_fullnamerr#r$r%rrZhas_ext_modulesZinstall_baseZinstall_platbaser)�reprrZmake_archiverrrrZ
dist_files�appendrrr.)rr+Zarchive_basenameZpseudoinstall_rootZarchive_root�filenameZ	pyversionrrr �runOsR


�

����
��
�zbdist_dumb.runN)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsr&r!r*r4rrrr r	s,���
�r	)�__doc__r#Zdistutils.corerZdistutils.utilrZdistutils.dir_utilrrZdistutils.errorsZdistutils.sysconfigrZ	distutilsrr	rrrr �<module>s__pycache__/config.cpython-38.opt-1.pyc000064400000023765150513660040013625 0ustar00U

e5d=3�@sldZddlZddlZddlmZddlmZddlmZddl	m
Z
ddd	�ZGd
d�de�Zddd
�Z
dS)a�distutils.command.config

Implements the Distutils 'config' command, a (mostly) empty command class
that exists mainly to be sub-classed by specific module distributions and
applications.  The idea is that while every "config" command is different,
at least they're all named the same, and users always see "config" in the
list of standard commands.  Also, this is a good place to put common
configure-like tasks: "try to compile this C code", or "figure out where
this header file lives".
�N)�Command)�DistutilsExecError)�customize_compiler)�logz.cz.cxx)�czc++c	@s�eZdZdZdddddddd	d
g	Zdd�Zd
d�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
d0dd �Zd1d!d"�Zd2d#d$�Zd3d%d&�Zd4d'd(�Zd5d*d+�Zdddgfd,d-�Zd6d.d/�ZdS)7�configzprepare to build)z	compiler=Nzspecify the compiler type)zcc=Nzspecify the compiler executable)z
include-dirs=�Iz.list of directories to search for header files)zdefine=�DzC preprocessor macros to define)zundef=�Uz!C preprocessor macros to undefine)z
libraries=�lz!external C libraries to link with)z
library-dirs=�Lz.directories to search for external C libraries)�noisyNz1show every action (compile, link, run, ...) taken)zdump-sourceNz=dump generated source files before attempting to compile themcCs4d|_d|_d|_d|_d|_d|_d|_g|_dS)N�)�compilerZcc�include_dirs�	libraries�library_dirsr
�dump_source�
temp_files��self�r�0/usr/lib64/python3.8/distutils/command/config.py�initialize_options3szconfig.initialize_optionscCs�|jdkr|jjpg|_nt|jt�r6|j�tj�|_|jdkrHg|_nt|jt�r^|jg|_|jdkrpg|_nt|jt�r�|j�tj�|_dS�N)	rZdistribution�
isinstance�str�split�os�pathseprrrrrr�finalize_optionsBs



zconfig.finalize_optionscCsdSrrrrrr�runRsz
config.runcCszddlm}m}t|j|�sv||j|jdd�|_t|j�|jrN|j�|j�|j	rb|j�
|j	�|jrv|j�|j�dS)z^Check that 'self.compiler' really is a CCompiler object;
        if not, make it one.
        r)�	CCompiler�new_compilerr)r�dry_runZforceN)
�distutils.ccompilerr"r#rrr$rrZset_include_dirsrZ
set_librariesrZset_library_dirs)rr"r#rrr�_check_compilerYs�
zconfig._check_compilerc	Csldt|}t|d��L}|r>|D]}|�d|�q |�d�|�|�|ddkr^|�d�W5QRX|S)NZ_configtest�wz#include <%s>
�
���)�LANG_EXT�open�write)r�body�headers�lang�filename�file�headerrrr�_gen_temp_sourcefileks

zconfig._gen_temp_sourcefilecCs<|�|||�}d}|j�||g�|jj|||d�||fS)Nz
_configtest.i�r)r3r�extendrZ
preprocess)rr-r.rr/�src�outrrr�_preprocessws
zconfig._preprocesscCs\|�|||�}|jr"t|d|�|j�|g�\}|j�||g�|jj|g|d�||fS)Nzcompiling '%s':r4)r3r�	dump_filerZobject_filenamesrr5�compile)rr-r.rr/r6�objrrr�_compile~szconfig._compilec
Csr|�||||�\}}tj�tj�|��d}	|jj|g|	|||d�|jjdk	r\|	|jj}	|j�	|	�|||	fS)Nr)rrZtarget_lang)
r<r�path�splitext�basenamerZlink_executableZ
exe_extensionr�append)
rr-r.rrrr/r6r;�progrrr�_link�s�zconfig._linkc	GsT|s|j}g|_t�dd�|��|D](}zt�|�Wq&tk
rLYq&Xq&dS)Nzremoving: %s� )rr�info�joinr�remove�OSError)r�	filenamesr0rrr�_clean�sz
config._cleanNrcCsRddlm}|��d}z|�||||�Wn|k
rDd}YnX|��|S)aQConstruct a source file from 'body' (a string containing lines
        of C/C++ code) and 'headers' (a list of header files to include)
        and run it through the preprocessor.  Return true if the
        preprocessor succeeded, false if there were any errors.
        ('body' probably isn't of much use, but what the heck.)
        r��CompileErrorTF)r%rKr&r8rI�rr-r.rr/rK�okrrr�try_cpp�s
zconfig.try_cppc	Csx|��|�||||�\}}t|t�r0t�|�}t|��.}d}	|��}
|
dkrPqb|�|
�r>d}	qbq>W5QRX|�	�|	S)a�Construct a source file (just like 'try_cpp()'), run it through
        the preprocessor, and return true if any line of the output matches
        'pattern'.  'pattern' should either be a compiled regex object or a
        string containing a regex.  If both 'body' and 'headers' are None,
        preprocesses an empty file -- which can be useful to determine the
        symbols the preprocessor and compiler set by default.
        F�T)
r&r8rr�rer:r+�readline�searchrI)r�patternr-r.rr/r6r7r1�match�linerrr�
search_cpp�s	



zconfig.search_cppcCsdddlm}|��z|�||||�d}Wn|k
rDd}YnXt�|rRdpTd�|��|S)zwTry to compile a source file built from 'body' and 'headers'.
        Return true on success, false otherwise.
        rrJTF�success!�failure.)r%rKr&r<rrDrIrLrrr�try_compile�s
zconfig.try_compilec
	Cspddlm}m}|��z|�||||||�d}	Wn||fk
rPd}	YnXt�|	r^dp`d�|��|	S)z�Try to compile and link a source file, built from 'body' and
        'headers', to executable form.  Return true on success, false
        otherwise.
        r�rK�	LinkErrorTFrWrX)r%rKr[r&rBrrDrI)
rr-r.rrrr/rKr[rMrrr�try_link�s
�
zconfig.try_linkc

Cs�ddlm}m}|��z.|�||||||�\}	}
}|�|g�d}Wn||tfk
rdd}YnXt�|rrdptd�|�	�|S)z�Try to compile, link to an executable, and run a program
        built from 'body' and 'headers'.  Return true on success, false
        otherwise.
        rrZTFrWrX)
r%rKr[r&rBZspawnrrrDrI)
rr-r.rrrr/rKr[r6r;ZexerMrrr�try_run�s
�

zconfig.try_runrc	Cst|��g}|r|�d|�|�d�|r<|�d|�n|�d|�|�d�d�|�d}|�|||||�S)a�Determine if function 'func' is available by constructing a
        source file that refers to 'func', and compiles and links it.
        If everything succeeds, returns true; otherwise returns false.

        The constructed source file starts out by including the header
        files listed in 'headers'.  If 'decl' is true, it then declares
        'func' (as "int func()"); you probably shouldn't supply 'headers'
        and set 'decl' true in the same call, or you might get errors about
        a conflicting declarations for 'func'.  Finally, the constructed
        'main()' function either references 'func' or (if 'call' is true)
        calls it.  'libraries' and 'library_dirs' are used when
        linking.
        z
int %s ();z
int main () {z  %s();z  %s;�}r()r&r@rEr\)	r�funcr.rrrZdeclZcallr-rrr�
check_funcs


�zconfig.check_funccCs |��|�d|||g||�S)a�Determine if 'library' is available to be linked against,
        without actually checking that any particular symbols are provided
        by it.  'headers' will be used in constructing the source file to
        be compiled, but the only effect of this is to check if all the
        header files listed are available.  Any libraries listed in
        'other_libraries' will be included in the link, in case 'library'
        has symbols that depend on other libraries.
        zint main (void) { })r&r\)rZlibraryrr.rZother_librariesrrr�	check_lib4s


�zconfig.check_libcCs|jd|g|d�S)z�Determine if the system header file named by 'header_file'
        exists and can be found by the preprocessor; return true if so,
        false otherwise.
        z
/* No body */)r-r.r)rN)rr2rrr/rrr�check_headerBs
�zconfig.check_header)NNNr)NNNr)NNr)NNNNr)NNNNr)NNNNrr)NNr)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsrr r!r&r3r8r<rBrIrNrVrYr\r]r`rarbrrrrrs\�	
�

�
�
�
�
�rcCsJ|dkrt�d|�n
t�|�t|�}zt�|���W5|��XdS)zjDumps a file content into log.info.

    If head is not None, will be dumped before the file content.
    Nz%s)rrDr+�close�read)r0�headr1rrrr9Ks
r9)N)�__doc__rrPZdistutils.corerZdistutils.errorsrZdistutils.sysconfigrZ	distutilsrr*rr9rrrr�<module>s
8__pycache__/check.cpython-38.opt-2.pyc000064400000010337150513660040013425 0ustar00U

e5d��@s�ddlmZddlmZzTddlmZddlmZddlm	Z	ddlm
Z
ddlmZGdd	�d	e�Z
d
ZWnek
r�dZYnXGdd
�d
e�ZdS)�)�Command)�DistutilsSetupError)�Reporter)�Parser)�frontend)�nodes)�StringIOc@seZdZd	dd�Zdd�ZdS)
�SilentReporterNr�ascii�replacec
Cs"g|_t�||||||||�dS�N)�messagesr�__init__)�self�source�report_level�
halt_level�stream�debug�encoding�
error_handler�r�//usr/lib64/python3.8/distutils/command/check.pyrs�zSilentReporter.__init__cOs6|j�||||f�tj|f|�||j|d�|��S)N)�level�type)r
�appendr�system_messageZlevels)rr�messageZchildren�kwargsrrrrs���zSilentReporter.system_message)Nrr
r)�__name__�
__module__�__qualname__rrrrrrr	s�
r	TFc@s\eZdZdZdddgZdddgZdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�ZdS)�checkz"perform some checks on the package)�metadata�mzVerify meta-data)�restructuredtext�rzEChecks if long string meta-data syntax are reStructuredText-compliant)�strict�sz(Will exit with an error if a check failsr#r%r'cCsd|_d|_d|_d|_dS)Nr�)r%r#r'�	_warnings�rrrr�initialize_options1szcheck.initialize_optionscCsdSrrr+rrr�finalize_options8szcheck.finalize_optionscCs|jd7_t�||�S)Nr))r*r�warn)r�msgrrrr.;sz
check.warncCsL|jr|��|jr0tr"|��n|jr0td��|jrH|jdkrHtd��dS)NzThe docutils package is needed.rzPlease correct your package.)r#�check_metadatar%�HAS_DOCUTILS�check_restructuredtextr'rr*r+rrr�run@s
z	check.runcCs�|jj}g}dD]"}t||�r(t||�s|�|�q|rL|�dd�|��|jrd|js�|�d�n"|j	r||j
s�|�d�n
|�d�dS)N)�name�versionZurlzmissing required meta-data: %sz, zLmissing meta-data: if 'author' supplied, 'author_email' must be supplied toozTmissing meta-data: if 'maintainer' supplied, 'maintainer_email' must be supplied toozimissing meta-data: either (author and author_email) or (maintainer and maintainer_email) must be supplied)�distributionr#�hasattr�getattrrr.�joinZauthorZauthor_emailZ
maintainerZmaintainer_email)rr#Zmissing�attrrrrr0Pszcheck.check_metadatacCsX|j��}|�|�D]>}|d�d�}|dkr8|d}nd|d|f}|�|�qdS)N����liner)z%s (line %s))r6Zget_long_description�_check_rst_data�getr.)r�dataZwarningr<rrrr2ns

zcheck.check_restructuredtextc
Cs�|jjp
d}t�}tjtfd���}d|_d|_d|_t	||j
|j|j|j
|j|jd�}tj|||d�}|�|d�z|�||�Wn:tk
r�}z|j�dd|dif�W5d}~XYnX|jS)	Nzsetup.py)Z
components�)rrrr)rr;z!Could not finish the parsing: %s.�)r6Zscript_namerrZOptionParserZget_default_valuesZ	tab_widthZpep_referencesZrfc_referencesr	rrZwarning_streamrZerror_encodingZerror_encoding_error_handlerr�documentZnote_source�parse�AttributeErrorr
r)rr?�source_path�parserZsettingsZreporterrB�errrr=ys.��zcheck._check_rst_dataN)
rr r!ZdescriptionZuser_optionsZboolean_optionsr,r-r.r3r0r2r=rrrrr"$s�
r"N)Zdistutils.corerZdistutils.errorsrZdocutils.utilsrZdocutils.parsers.rstrZdocutilsrr�iorr	r1�	Exceptionr"rrrr�<module>s
__pycache__/clean.cpython-38.opt-1.pyc000064400000004066150513660040013433 0ustar00U

e5d�
�@sDdZddlZddlmZddlmZddlmZGdd�de�ZdS)zBdistutils.command.clean

Implements the Distutils 'clean' command.�N)�Command)�remove_tree)�logc@s>eZdZdZddddddgZdgZd	d
�Zdd�Zd
d�ZdS)�cleanz-clean up temporary files from 'build' command)zbuild-base=�bz2base build directory (default: 'build.build-base'))z
build-lib=Nz<build directory for all modules (default: 'build.build-lib'))zbuild-temp=�tz7temporary build directory (default: 'build.build-temp'))zbuild-scripts=Nz<build directory for scripts (default: 'build.build-scripts'))zbdist-base=Nz+temporary directory for built distributions)�all�az7remove all build output, not just temporary by-productsrcCs(d|_d|_d|_d|_d|_d|_dS)N)�
build_base�	build_lib�
build_temp�
build_scripts�
bdist_baser��self�r�//usr/lib64/python3.8/distutils/command/clean.py�initialize_options szclean.initialize_optionscCs"|�ddddd�|�dd�dS)NZbuild)r
r
)rr)r
r
)rrZbdist)rr)Zset_undefined_optionsrrrr�finalize_options(s��zclean.finalize_optionscCs�tj�|j�r t|j|jd�nt�d|j�|jrr|j	|j
|jfD],}tj�|�rdt||jd�qDt�d|�qD|js�zt�
|j�t�d|j�Wntk
r�YnXdS)N)�dry_runz%'%s' does not exist -- can't clean itz
removing '%s')�os�path�existsrrrr�debugrrrr
�warn�rmdirr
�info�OSError)rZ	directoryrrr�run1s*���z	clean.runN)	�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrrrrrrs�	r)	�__doc__rZdistutils.corerZdistutils.dir_utilrZ	distutilsrrrrrr�<module>s
__pycache__/build.cpython-38.opt-2.pyc000064400000007330150513660040013446 0ustar00U

e5d��@sPddlZddlZddlmZddlmZddlmZdd�ZGdd�de�Z	dS)	�N)�Command)�DistutilsOptionError)�get_platformcCsddlm}|�dS)Nr��show_compilers)Zdistutils.ccompilerrr�r�//usr/lib64/python3.8/distutils/command/build.pyrsrc@s�eZdZdZdddddddd	d
e�fddd
ddgZddgZdddefgZdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd �Zd!d"�Zd#efd$e
fd%efd&efgZdS)'�buildz"build everything needed to install)zbuild-base=�bz base directory for build library)zbuild-purelib=Nz2build directory for platform-neutral distributions)zbuild-platlib=Nz3build directory for platform-specific distributions)z
build-lib=NzWbuild directory for all distribution (defaults to either build-purelib or build-platlib)zbuild-scripts=Nzbuild directory for scripts)zbuild-temp=�tztemporary build directoryz
plat-name=�pz6platform name to build for, if supported (default: %s))z	compiler=�czspecify the compiler type)z	parallel=�jznumber of parallel build jobs)�debug�gz;compile extensions and libraries with debugging information)�force�fz2forcibly build everything (ignore file timestamps))zexecutable=�ez5specify final destination interpreter path (build.py)rrz
help-compilerNzlist available compilerscCsLd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_dS)Nr	r)�
build_base�
build_purelib�
build_platlib�	build_lib�
build_temp�
build_scriptsZcompiler�	plat_namerr�
executable�parallel��selfrrr�initialize_options8szbuild.initialize_optionscCsb|jdkrt�|_ntjdkr&td��d|jftjdd��}ttd�rR|d7}|jdkrntj	�
|jd�|_|jdkr�tj	�
|jd|�|_|j
dkr�|jjr�|j|_
n|j|_
|jdkr�tj	�
|jd|�|_|jdkr�tj	�
|jd	tjdd��|_|jdk�r tj�r tj	�tj�|_t|jt��r^zt|j�|_Wntk
�r\td
��YnXdS)N�ntzW--plat-name only supported on Windows (try using './configure --help' on your platform)z	.%s-%d.%d�Zgettotalrefcountz-pydebug�libZtempz
scripts-%d.%dzparallel should be an integer)rr�os�namer�sys�version_info�hasattrr�path�joinrrr�distributionZext_modulesrrr�normpath�
isinstancer�str�int�
ValueError)rZplat_specifierrrr�finalize_optionsHsD


�



�



�

�zbuild.finalize_optionscCs|��D]}|�|�qdS�N)Zget_sub_commandsZrun_command)rZcmd_namerrr�run�sz	build.runcCs
|j��Sr1)r*�has_pure_modulesrrrrr3�szbuild.has_pure_modulescCs
|j��Sr1)r*�has_c_librariesrrrrr4�szbuild.has_c_librariescCs
|j��Sr1)r*�has_ext_modulesrrrrr5�szbuild.has_ext_modulescCs
|j��Sr1)r*�has_scriptsrrrrr6�szbuild.has_scriptsZbuild_pyZ
build_clibZ	build_extr)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsrr0r2r3r4r5r6Zsub_commandsrrrrr	sH�����8�r	)
r%r#Zdistutils.corerZdistutils.errorsrZdistutils.utilrrr	rrrr�<module>s
__pycache__/install_scripts.cpython-38.opt-1.pyc000064400000004137150513660040015565 0ustar00U

e5d��@sDdZddlZddlmZddlmZddlmZGdd�de�ZdS)zudistutils.command.install_scripts

Implements the Distutils 'install_scripts' command, for installing
Python scripts.�N)�Command)�log)�ST_MODEc@sLeZdZdZddddgZddgZdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�install_scriptsz%install scripts (Python or otherwise))zinstall-dir=�dzdirectory to install scripts to)z
build-dir=�bz'build directory (where to install from))�force�fz-force installation (overwrite existing files))�
skip-buildNzskip the build stepsrr
cCsd|_d|_d|_d|_dS)Nr)�install_dirr�	build_dir�
skip_build��self�r�9/usr/lib64/python3.8/distutils/command/install_scripts.py�initialize_optionssz"install_scripts.initialize_optionscCs |�dd�|�dddd�dS)NZbuild)�
build_scriptsrZinstall)rr)rr)r
r
)Zset_undefined_optionsrrrr�finalize_options!s�z install_scripts.finalize_optionscCs�|js|�d�|�|j|j�|_tjdkr~|��D]H}|j	rLt
�d|�q4t�|�t
dBd@}t
�d||�t�||�q4dS)Nr�posixzchanging mode of %simi�zchanging mode of %s to %o)r
Zrun_commandZ	copy_treerr�outfiles�os�name�get_outputsZdry_runr�info�statr�chmod)r�file�moderrr�run)s

zinstall_scripts.runcCs|jjp
gS�N)ZdistributionZscriptsrrrr�
get_inputs8szinstall_scripts.get_inputscCs
|jpgSr )rrrrrr;szinstall_scripts.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrr!rrrrrrs�r)	�__doc__rZdistutils.corerZ	distutilsrrrrrrrr�<module>s
__pycache__/install.cpython-38.opt-1.pyc000064400000032663150513660040014023 0ustar00U

&�.e�j�@sdZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZmZmZdd
lmZddlmZddlmZdd
lmZdZdddddd�Zdddddd�dddddd�ed�Ze�rdddddd�ed <ddd!d"dd�ed#<dZGd$d%�d%e�ZdS)&zFdistutils.command.install

Implements the Distutils 'install' command.�N)�log)�Command)�DEBUG)�get_config_vars)�DistutilsPlatformError)�
write_file)�convert_path�
subst_vars�change_root)�get_platform)�DistutilsOptionError)�	USER_BASE)�	USER_SITETz$base/Lib/site-packagesz$base/Include/$dist_namez
$base/Scriptsz$base)�purelib�platlib�headers�scripts�dataz/$base/lib/python$py_version_short/site-packagesz5$platbase/lib64/python$py_version_short/site-packagesz9$base/include/python$py_version_short$abiflags/$dist_namez	$base/binz$base/lib/pythonz$base/lib64/pythonz$base/include/python/$dist_name)�unix_prefix�	unix_home�ntz	$usersitez4$userbase/Python$py_version_nodot/Include/$dist_namez)$userbase/Python$py_version_nodot/Scriptsz	$userbaseZnt_userz=$userbase/include/python$py_version_short$abiflags/$dist_namez
$userbase/bin�	unix_userc@s:eZdZdZdddddddd	d
ddd
ddddddgZdddgZer`e�dddef�e�d�ddiZ	dd�Z
dd�Zdd �Zd!d"�Z
d#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Zd?d@�ZdAdB�ZdCdD�ZdEefdFefdGefdHefdIdJdK�fgZdS)L�installz'install everything from build directory)zprefix=Nzinstallation prefix)zexec-prefix=Nz.(Unix only) prefix for platform-specific files)zhome=Nz+(Unix only) home directory to install under)z
install-base=Nz;base installation directory (instead of --prefix or --home))zinstall-platbase=Nz\base installation directory for platform-specific files (instead of --exec-prefix or --home))zroot=Nz<install everything relative to this alternate root directory)zinstall-purelib=Nz;installation directory for pure Python module distributions)zinstall-platlib=Nz8installation directory for non-pure module distributions)zinstall-lib=Nzginstallation directory for all module distributions (overrides --install-purelib and --install-platlib))zinstall-headers=Nz(installation directory for C/C++ headers)zinstall-scripts=Nz)installation directory for Python scripts)z
install-data=Nz%installation directory for data files)�compile�czcompile .py to .pyc [default])�
no-compileNzdon't compile .py files)z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�force�fz1force installation (overwrite any existing files))�
skip-buildNz2skip rebuilding everything (for testing/debugging))zrecord=Nz3filename in which to record list of installed filesrrr�userNz!install in user site-package '%s'rcCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_t
|_t|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)zInitializes options.Nr�)�prefix�exec_prefix�homer �install_base�install_platbase�root�install_purelib�install_platlib�install_headers�install_lib�install_scripts�install_datar
�install_userbaser�install_usersiter�optimize�
extra_path�install_path_filer�
skip_build�warn_dir�
build_base�	build_lib�record��self�r:�1/usr/lib64/python3.8/distutils/command/install.py�initialize_options�s2zinstall.initialize_optionscCsx|js|js|jr&|js|jr&td��|jr@|js8|jr@td��|jrl|jsd|jsd|jsd|jsd|jrltd��tjdkr�|jr�|�	d�d|_|�
d�tjdkr�|��n|��|�
d�t
j��d	}td
d�\}}z
t
j}Wntk
r�d}YnX|j��|j��|j��|d
t
jdd�dt
jdd�|||||d�|_t�rf|j|jd<|j|jd<|��|�
d�|j|jd<|j|jd<t�r�d	dlm}td�||j�|� �|�
d�|j�r�|�!�|j"dk�r�|jj#�r�|j$|_"n|j%|_"|�&dddddddd�|�'�|j"|_(tj)�*|j"|j+�|_"|j,dk	�r\|�-ddddddd�|�
d �|�.d!d"d#�dS)$zFinalizes options.zWmust supply either prefix/exec-prefix/home or install-base/install-platbase -- not bothz9must supply either home or prefix/exec-prefix -- not bothzGcan't combine user with prefix, exec_prefix/home, or install_(plat)base�posixz+exec-prefix option ignored on this platformNzpre-finalize_{unix,other}zpost-finalize_{unix,other}()rr"r#�z%d.%d�z%d%d)Z	dist_nameZdist_versionZ
dist_fullname�
py_versionZpy_version_shortZpy_version_nodotZ
sys_prefixr"Zsys_exec_prefixr#�abiflags�userbaseZusersitezpost-expand_basedirs()�baseZplatbase)�pprintzconfig vars:zpost-expand_dirs()�librrrrrZlibbasezafter prepending root�build)r5r5)r6r6)/r"r#r$r%r&rr �os�name�warn�	dump_dirs�
finalize_unix�finalize_other�sys�version�splitrrA�AttributeError�distributionZget_nameZget_versionZget_fullname�version_info�config_vars�
HAS_USER_SITEr.r/�expand_basedirsrrD�print�expand_dirs�create_home_pathr+Zext_modulesr)r(�
convert_paths�handle_extra_path�install_libbase�path�join�
extra_dirsr'�change_rootsZset_undefined_options)r9r@r"r#rArDr:r:r;�finalize_options�s�������








�






�	�
�zinstall.finalize_optionscCs�tsdSddlm}t�|d�|jD]r}|d}|ddkrL|dd�}||jkrx|j|}|�|�}t||�}n|�|�}t||�}t�d||�q(dS)zDumps the list of user options.Nr)�
longopt_xlate�:����=z  %s: %s)	rZdistutils.fancy_getoptrar�debug�user_options�negative_opt�	translate�getattr)r9�msgra�optZopt_name�valr:r:r;rJus





zinstall.dump_dirscCsV|jdk	s|jdk	r\|jdkr2|jdkr2|jdksP|jdksP|jdksP|jdkrXtd��dS|j	r�|j
dkrttd��|j
|_|_|�d�n�|j
dk	r�|j
|_|_|�d�n�|jdk�r$|jdk	r�td��ttd�s�tjtjks�dtjkr�d	}nd
}tj�tj�||_tj�tj�||_n|jdk�r8|j|_|j|_|j|_|�d�dS)z&Finalizes options for posix platforms.NzPinstall-base or install-platbase supplied, but installation scheme is incomplete�$User base directory is not specifiedrrz*must not supply exec-prefix without prefixZreal_prefix�RPM_BUILD_ROOTz/localr>r)r%r&r+r(r)r*r,r-rr r.r�
select_schemer$r"r#�hasattrrM�base_prefixrG�environr\�normpath)r9Zadditionr:r:r;rK�sZ
������
�

�

��zinstall.finalize_unixcCs�|jr8|jdkrtd��|j|_|_|�tjd�n�|jdk	r\|j|_|_|�d�n\|j	dkrvtj
�tj	�|_	|j	|_|_z|�tj�Wn"t
k
r�tdtj��YnXdS)z)Finalizes options for non-posix platformsNrmZ_userrz)I don't know how to install stuff on '%s')r r.rr%r&rorGrHr$r"r\rsrM�KeyErrorr8r:r:r;rL�s&
�

�zinstall.finalize_othercCs<t|}tD]*}d|}t||�dkrt||||�qdS)z=Sets the install directories by applying the install schemes.�install_N)�INSTALL_SCHEMES�SCHEME_KEYSri�setattr)r9rHZscheme�key�attrnamer:r:r;ro�s
zinstall.select_schemecCsX|D]N}t||�}|dk	rtjdks.tjdkr:tj�|�}t||j�}t|||�qdS)Nr=r)rirGrHr\�
expanduserr	rSrx)r9�attrs�attrrlr:r:r;�
_expand_attrs�s
zinstall._expand_attrscCs|�dddg�dS)zNCalls `os.path.expanduser` on install_base, install_platbase and
        root.r%r&r'N�r~r8r:r:r;rU�szinstall.expand_basedirscCs|�ddddddg�dS)z+Calls `os.path.expanduser` on install dirs.r(r)r+r*r,r-Nrr8r:r:r;rW�s�zinstall.expand_dirscGs,|D]"}d|}t||tt||���qdS)z!Call `convert_path` over `names`.ruN)rxrri�r9�namesrHr}r:r:r;rY�szinstall.convert_pathscCs�|jdkr|jj|_|jdk	r�t�d�t|jt�rB|j�d�|_t|j�dkr`|jd}}n"t|j�dkrz|j\}}ntd��t	|�}nd}d}||_
||_dS)	z4Set `path_file` and `extra_dirs` using `extra_path`.NzIDistribution option extra_path is deprecated. See issue27919 for details.�,r!rr?zY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsr>)r1rQrrI�
isinstance�strrO�lenrr�	path_filer^)r9r�r^r:r:r;rZ�s(


��
zinstall.handle_extra_pathc	Gs0|D]&}d|}t||t|jt||���qdS)z:Change the install directories pointed by name using root.ruN)rxr
r'rir�r:r:r;r_szinstall.change_rootscCsb|js
dSttj�d��}|j��D]8\}}|�|�r$tj�|�s$|�	d|�t�
|d�q$dS)zCreate directories under ~.N�~zos.makedirs('%s', 0o700)i�)r rrGr\r{rS�items�
startswith�isdirZdebug_print�makedirs)r9r$rHr\r:r:r;rXszinstall.create_home_pathcCs"|js6|�d�|j�d�j}|jr6|t�kr6td��|��D]}|�|�q>|j	r\|�
�|jr�|��}|j
r�t|j
�}tt|��D]}|||d�||<q�|�t|j|fd|j�ttjjtj�}ttjj|�}tj�tj�|j��}|j�r|j	�r|j�s||k�rt�d|j�dS)zRuns the command.rFz"Can't install when cross-compilingNz'writing list of installed files to '%s'z�modules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)r3Zrun_commandrQZget_command_objZ	plat_namer4rr�get_sub_commandsr��create_path_filer7�get_outputsr'r��range�executer�maprGr\rsrM�normcaser+r2rre)r9Z
build_plat�cmd_name�outputsZroot_lenZcounterZsys_pathr+r:r:r;�run(sD

������zinstall.runcCsJtj�|j|jd�}|jr8|�t||jgfd|�n|�	d|�dS)zCreates the .pth file�.pthzcreating %szpath file '%s' not createdN)
rGr\r]r[r�r2r�rr^rI)r9�filenamer:r:r;r�Ts
�
�zinstall.create_path_filecCshg}|��D].}|�|�}|��D]}||kr"|�|�q"q|jrd|jrd|�tj�|j	|jd��|S)z.Assembles the outputs of all the sub-commands.r�)
r��get_finalized_commandr��appendr�r2rGr\r]r[)r9r�r��cmdr�r:r:r;r�bs
�zinstall.get_outputscCs.g}|��D]}|�|�}|�|���q|S)z*Returns the inputs of all the sub-commands)r�r��extend�
get_inputs)r9Zinputsr�r�r:r:r;r�ss

zinstall.get_inputscCs|j��p|j��S)zSReturns true if the current distribution has any Python
        modules to install.)rQZhas_pure_modulesZhas_ext_modulesr8r:r:r;�has_libs
�zinstall.has_libcCs
|j��S)zLReturns true if the current distribution has any headers to
        install.)rQ�has_headersr8r:r:r;r��szinstall.has_headerscCs
|j��S)zMReturns true if the current distribution has any scripts to.
        install.)rQ�has_scriptsr8r:r:r;r��szinstall.has_scriptscCs
|j��S)zJReturns true if the current distribution has any data to.
        install.)rQZhas_data_filesr8r:r:r;�has_data�szinstall.has_datar+r*r,r-Zinstall_egg_infocCsdS)NTr:r8r:r:r;�<lambda>��zinstall.<lambda>) �__name__�
__module__�__qualname__ZdescriptionrfZboolean_optionsrTr�rrgr<r`rJrKrLror~rUrWrYrZr_rXr�r�r�r�r�r�r�r�Zsub_commandsr:r:r:r;rIsn	�;
�
N3		",
�r)�__doc__rMrGZ	distutilsrZdistutils.corerZdistutils.debugrZdistutils.sysconfigrZdistutils.errorsrZdistutils.file_utilrZdistutils.utilrr	r
rrZsiter
rrTZWINDOWS_SCHEMErvrwrr:r:r:r;�<module>sb�
����
	�
__pycache__/install_data.cpython-38.pyc000064400000004363150513660040014051 0ustar00U

e5d�@s<dZddlZddlmZddlmZmZGdd�de�ZdS)z�distutils.command.install_data

Implements the Distutils 'install_data' command, for installing
platform-independent data files.�N)�Command)�change_root�convert_pathc@sHeZdZdZdddgZdgZdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�install_datazinstall data files)zinstall-dir=�dzIbase directory for installing data files (default: installation base dir))zroot=Nz<install everything relative to this alternate root directory)�force�fz-force installation (overwrite existing files)rcCs,d|_g|_d|_d|_|jj|_d|_dS)Nr�)�install_dir�outfiles�rootrZdistribution�
data_files�warn_dir��self�r�6/usr/lib64/python3.8/distutils/command/install_data.py�initialize_optionss
zinstall_data.initialize_optionscCs|�dddd�dS)NZinstall)rr
)rr)rr)Zset_undefined_optionsrrrr�finalize_options#s
�zinstall_data.finalize_optionscCs�|�|j�|jD]�}t|t�rbt|�}|jrB|�d||jf�|�||j�\}}|j	�
|�qt|d�}tj�
|�s�tj�|j|�}n|jr�t|j|�}|�|�|dgkr�|j	�
|�q|dD](}t|�}|�||�\}}|j	�
|�q�qdS)NzMsetup script did not provide a directory for '%s' -- installing right in '%s'rr	)Zmkpathr
r
�
isinstance�strrr�warnZ	copy_filer�append�os�path�isabs�joinrr)rr�out�_�dir�datarrr�run*s,

�
zinstall_data.runcCs
|jpgS�N)r
rrrr�
get_inputsKszinstall_data.get_inputscCs|jSr")rrrrr�get_outputsNszinstall_data.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrr!r#r$rrrrrs�	!r)�__doc__rZdistutils.corerZdistutils.utilrrrrrrr�<module>s__pycache__/install_scripts.cpython-38.opt-2.pyc000064400000003731150513660050015566 0ustar00U

e5d��@s@ddlZddlmZddlmZddlmZGdd�de�ZdS)�N)�Command)�log)�ST_MODEc@sLeZdZdZddddgZddgZdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�install_scriptsz%install scripts (Python or otherwise))zinstall-dir=�dzdirectory to install scripts to)z
build-dir=�bz'build directory (where to install from))�force�fz-force installation (overwrite existing files))�
skip-buildNzskip the build stepsrr
cCsd|_d|_d|_d|_dS)Nr)�install_dirr�	build_dir�
skip_build��self�r�9/usr/lib64/python3.8/distutils/command/install_scripts.py�initialize_optionssz"install_scripts.initialize_optionscCs |�dd�|�dddd�dS)NZbuild)�
build_scriptsrZinstall)rr)rr)r
r
)Zset_undefined_optionsrrrr�finalize_options!s�z install_scripts.finalize_optionscCs�|js|�d�|�|j|j�|_tjdkr~|��D]H}|j	rLt
�d|�q4t�|�t
dBd@}t
�d||�t�||�q4dS)Nr�posixzchanging mode of %simi�zchanging mode of %s to %o)r
Zrun_commandZ	copy_treerr�outfiles�os�name�get_outputsZdry_runr�info�statr�chmod)r�file�moderrr�run)s

zinstall_scripts.runcCs|jjp
gS�N)ZdistributionZscriptsrrrr�
get_inputs8szinstall_scripts.get_inputscCs
|jpgSr )rrrrrr;szinstall_scripts.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrr!rrrrrrs�r)rZdistutils.corerZ	distutilsrrrrrrrr�<module>s__pycache__/install.cpython-38.opt-2.pyc000064400000030624150513660050014020 0ustar00U

&�.e�j�@sddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZmZmZdd	lmZdd
l
mZddlmZddlmZd
Zdddddd�Zdddddd�dddddd�ed�Ze�rdddddd�ed<ddd d!dd�ed"<dZGd#d$�d$e�ZdS)%�N)�log)�Command)�DEBUG)�get_config_vars)�DistutilsPlatformError)�
write_file)�convert_path�
subst_vars�change_root)�get_platform)�DistutilsOptionError)�	USER_BASE)�	USER_SITETz$base/Lib/site-packagesz$base/Include/$dist_namez
$base/Scriptsz$base)�purelib�platlib�headers�scripts�dataz/$base/lib/python$py_version_short/site-packagesz5$platbase/lib64/python$py_version_short/site-packagesz9$base/include/python$py_version_short$abiflags/$dist_namez	$base/binz$base/lib/pythonz$base/lib64/pythonz$base/include/python/$dist_name)�unix_prefix�	unix_home�ntz	$usersitez4$userbase/Python$py_version_nodot/Include/$dist_namez)$userbase/Python$py_version_nodot/Scriptsz	$userbaseZnt_userz=$userbase/include/python$py_version_short$abiflags/$dist_namez
$userbase/bin�	unix_userc@s:eZdZdZdddddddd	d
ddd
ddddddgZdddgZer`e�dddef�e�d�ddiZ	dd�Z
dd�Zdd �Zd!d"�Z
d#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Zd?d@�ZdAdB�ZdCdD�ZdEefdFefdGefdHefdIdJdK�fgZdS)L�installz'install everything from build directory)zprefix=Nzinstallation prefix)zexec-prefix=Nz.(Unix only) prefix for platform-specific files)zhome=Nz+(Unix only) home directory to install under)z
install-base=Nz;base installation directory (instead of --prefix or --home))zinstall-platbase=Nz\base installation directory for platform-specific files (instead of --exec-prefix or --home))zroot=Nz<install everything relative to this alternate root directory)zinstall-purelib=Nz;installation directory for pure Python module distributions)zinstall-platlib=Nz8installation directory for non-pure module distributions)zinstall-lib=Nzginstallation directory for all module distributions (overrides --install-purelib and --install-platlib))zinstall-headers=Nz(installation directory for C/C++ headers)zinstall-scripts=Nz)installation directory for Python scripts)z
install-data=Nz%installation directory for data files)�compile�czcompile .py to .pyc [default])�
no-compileNzdon't compile .py files)z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�force�fz1force installation (overwrite any existing files))�
skip-buildNz2skip rebuilding everything (for testing/debugging))zrecord=Nz3filename in which to record list of installed filesrrr�userNz!install in user site-package '%s'rcCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_t
|_t|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr�)�prefix�exec_prefix�homer �install_base�install_platbase�root�install_purelib�install_platlib�install_headers�install_lib�install_scripts�install_datar
�install_userbaser�install_usersiter�optimize�
extra_path�install_path_filer�
skip_build�warn_dir�
build_base�	build_lib�record��self�r:�1/usr/lib64/python3.8/distutils/command/install.py�initialize_options�s2zinstall.initialize_optionscCsx|js|js|jr&|js|jr&td��|jr@|js8|jr@td��|jrl|jsd|jsd|jsd|jsd|jrltd��tjdkr�|jr�|�	d�d|_|�
d�tjdkr�|��n|��|�
d�t
j��d}td	d
�\}}z
t
j}Wntk
r�d}YnX|j��|j��|j��|dt
jdd
�dt
jdd
�|||||d�|_t�rf|j|jd<|j|jd<|��|�
d�|j|jd<|j|jd<t�r�ddlm}td�||j�|� �|�
d�|j�r�|�!�|j"dk�r�|jj#�r�|j$|_"n|j%|_"|�&dddddddd�|�'�|j"|_(tj)�*|j"|j+�|_"|j,dk	�r\|�-ddddddd�|�
d�|�.d d!d"�dS)#NzWmust supply either prefix/exec-prefix/home or install-base/install-platbase -- not bothz9must supply either home or prefix/exec-prefix -- not bothzGcan't combine user with prefix, exec_prefix/home, or install_(plat)base�posixz+exec-prefix option ignored on this platformzpre-finalize_{unix,other}zpost-finalize_{unix,other}()rr"r#�z%d.%d�z%d%d)Z	dist_nameZdist_versionZ
dist_fullname�
py_versionZpy_version_shortZpy_version_nodotZ
sys_prefixr"Zsys_exec_prefixr#�abiflags�userbaseZusersitezpost-expand_basedirs()�baseZplatbase)�pprintzconfig vars:zpost-expand_dirs()�librrrrrZlibbasezafter prepending root�build)r5r5)r6r6)/r"r#r$r%r&rr �os�name�warn�	dump_dirs�
finalize_unix�finalize_other�sys�version�splitrrA�AttributeError�distributionZget_nameZget_versionZget_fullname�version_info�config_vars�
HAS_USER_SITEr.r/�expand_basedirsrrD�print�expand_dirs�create_home_pathr+Zext_modulesr)r(�
convert_paths�handle_extra_path�install_libbase�path�join�
extra_dirsr'�change_rootsZset_undefined_options)r9r@r"r#rArDr:r:r;�finalize_options�s�������








�






�	�
�zinstall.finalize_optionscCs�tsdSddlm}t�|d�|jD]r}|d}|ddkrL|dd�}||jkrx|j|}|�|�}t||�}n|�|�}t||�}t�d||�q(dS)Nr)�
longopt_xlate�:����=z  %s: %s)	rZdistutils.fancy_getoptrar�debug�user_options�negative_opt�	translate�getattr)r9�msgra�optZopt_name�valr:r:r;rJus





zinstall.dump_dirscCsV|jdk	s|jdk	r\|jdkr2|jdkr2|jdksP|jdksP|jdksP|jdkrXtd��dS|j	r�|j
dkrttd��|j
|_|_|�d�n�|j
dk	r�|j
|_|_|�d�n�|jdk�r$|jdk	r�td��ttd�s�tjtjks�dtjkr�d}nd	}tj�tj�||_tj�tj�||_n|jdk�r8|j|_|j|_|j|_|�d
�dS)NzPinstall-base or install-platbase supplied, but installation scheme is incomplete�$User base directory is not specifiedrrz*must not supply exec-prefix without prefixZreal_prefix�RPM_BUILD_ROOTz/localr>r)r%r&r+r(r)r*r,r-rr r.r�
select_schemer$r"r#�hasattrrM�base_prefixrG�environr\�normpath)r9Zadditionr:r:r;rK�sZ
������
�

�

��zinstall.finalize_unixcCs�|jr8|jdkrtd��|j|_|_|�tjd�n�|jdk	r\|j|_|_|�d�n\|j	dkrvtj
�tj	�|_	|j	|_|_z|�tj�Wn"t
k
r�tdtj��YnXdS)NrmZ_userrz)I don't know how to install stuff on '%s')r r.rr%r&rorGrHr$r"r\rsrM�KeyErrorr8r:r:r;rL�s&
�

�zinstall.finalize_othercCs<t|}tD]*}d|}t||�dkrt||||�qdS�NZinstall_)�INSTALL_SCHEMES�SCHEME_KEYSri�setattr)r9rHZscheme�key�attrnamer:r:r;ro�s
zinstall.select_schemecCsX|D]N}t||�}|dk	rtjdks.tjdkr:tj�|�}t||j�}t|||�qdS)Nr=r)rirGrHr\�
expanduserr	rSrx)r9�attrs�attrrlr:r:r;�
_expand_attrs�s
zinstall._expand_attrscCs|�dddg�dS)Nr%r&r'�r~r8r:r:r;rU�szinstall.expand_basedirscCs|�ddddddg�dS)Nr(r)r+r*r,r-rr8r:r:r;rW�s�zinstall.expand_dirscGs,|D]"}d|}t||tt||���qdSru)rxrri�r9�namesrHr}r:r:r;rY�szinstall.convert_pathscCs�|jdkr|jj|_|jdk	r�t�d�t|jt�rB|j�d�|_t|j�dkr`|jd}}n"t|j�dkrz|j\}}ntd��t	|�}nd}d}||_
||_dS)NzIDistribution option extra_path is deprecated. See issue27919 for details.�,r!rr?zY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsr>)r1rQrrI�
isinstance�strrO�lenrr�	path_filer^)r9r�r^r:r:r;rZ�s(


��
zinstall.handle_extra_pathc	Gs0|D]&}d|}t||t|jt||���qdSru)rxr
r'rir�r:r:r;r_szinstall.change_rootscCsb|js
dSttj�d��}|j��D]8\}}|�|�r$tj�|�s$|�	d|�t�
|d�q$dS)N�~zos.makedirs('%s', 0o700)i�)r rrGr\r{rS�items�
startswith�isdirZdebug_print�makedirs)r9r$rHr\r:r:r;rXszinstall.create_home_pathcCs"|js6|�d�|j�d�j}|jr6|t�kr6td��|��D]}|�|�q>|j	r\|�
�|jr�|��}|j
r�t|j
�}tt|��D]}|||d�||<q�|�t|j|fd|j�ttjjtj�}ttjj|�}tj�tj�|j��}|j�r|j	�r|j�s||k�rt�d|j�dS)NrFz"Can't install when cross-compilingz'writing list of installed files to '%s'z�modules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)r3Zrun_commandrQZget_command_objZ	plat_namer4rr�get_sub_commandsr��create_path_filer7�get_outputsr'r��range�executer�maprGr\rsrM�normcaser+r2rre)r9Z
build_plat�cmd_name�outputsZroot_lenZcounterZsys_pathr+r:r:r;�run(sD

������zinstall.runcCsJtj�|j|jd�}|jr8|�t||jgfd|�n|�	d|�dS)N�.pthzcreating %szpath file '%s' not created)
rGr\r]r[r�r2r�rr^rI)r9�filenamer:r:r;r�Ts
�
�zinstall.create_path_filecCshg}|��D].}|�|�}|��D]}||kr"|�|�q"q|jrd|jrd|�tj�|j	|jd��|S)Nr�)
r��get_finalized_commandr��appendr�r2rGr\r]r[)r9r�r��cmdr�r:r:r;r�bs
�zinstall.get_outputscCs.g}|��D]}|�|�}|�|���q|S�N)r�r��extend�
get_inputs)r9Zinputsr�r�r:r:r;r�ss

zinstall.get_inputscCs|j��p|j��Sr�)rQZhas_pure_modulesZhas_ext_modulesr8r:r:r;�has_libs
�zinstall.has_libcCs
|j��Sr�)rQ�has_headersr8r:r:r;r��szinstall.has_headerscCs
|j��Sr�)rQ�has_scriptsr8r:r:r;r��szinstall.has_scriptscCs
|j��Sr�)rQZhas_data_filesr8r:r:r;�has_data�szinstall.has_datar+r*r,r-Zinstall_egg_infocCsdS)NTr:r8r:r:r;�<lambda>��zinstall.<lambda>) �__name__�
__module__�__qualname__ZdescriptionrfZboolean_optionsrTr�rrgr<r`rJrKrLror~rUrWrYrZr_rXr�r�r�r�r�r�r�r�Zsub_commandsr:r:r:r;rIsn	�;
�
N3		",
�r)rMrGZ	distutilsrZdistutils.corerZdistutils.debugrZdistutils.sysconfigrZdistutils.errorsrZdistutils.file_utilrZdistutils.utilrr	r
rrZsiter
rrTZWINDOWS_SCHEMErvrwrr:r:r:r;�<module>s`�
����
	�
__pycache__/__init__.cpython-38.opt-1.pyc000064400000001041150513660050014077 0ustar00U

e5d�@s2dZddddddddd	d
ddd
ddddddgZdS)z\distutils.command

Package containing implementation of all the standard Distutils
commands.ZbuildZbuild_pyZ	build_extZ
build_clibZ
build_scriptsZcleanZinstallZinstall_libZinstall_headersZinstall_scriptsZinstall_dataZsdist�registerZbdistZ
bdist_dumbZ	bdist_rpmZ
bdist_wininstZcheckZuploadN)�__doc__�__all__�rr�2/usr/lib64/python3.8/distutils/command/__init__.py�<module>s(�__pycache__/build_ext.cpython-38.pyc000064400000037413150513660050013374 0ustar00U

e5dP{�@s�dZddlZddlZddlZddlZddlmZddlTddlm	Z	m
Z
ddlmZddlm
Z
ddlmZdd	lmZdd
lmZddlmZe�d�Zd
d�ZGdd�de�ZdS)z�distutils.command.build_ext

Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP).�N)�Command)�*)�customize_compiler�get_python_version)�get_config_h_filename)�newer_group)�	Extension)�get_platform)�log)�	USER_BASEz3^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$cCsddlm}|�dS)Nr��show_compilers)�distutils.ccompilerr
r�r�3/usr/lib64/python3.8/distutils/command/build_ext.pyr
sr
c@seZdZdZdejZddddde�fdd	d
defdd
ddddefddddddddddgZddddd gZ	d!d"d#e
fgZd$d%�Zd&d'�Z
d(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zejd6d7��Zd8d9�Zd:d;�Zd<d=�Zd>d?�Zd@dA�ZdBdC�ZdDdE�ZdFdG�Zd"S)H�	build_extz8build C/C++ extensions (compile/link to build directory)z (separated by '%s'))z
build-lib=�bz(directory for compiled extension modules)zbuild-temp=�tz1directory for temporary files (build by-products)z
plat-name=�pz>platform name to cross-compile for, if supported (default: %s))�inplace�iziignore build-lib and put compiled extensions into the source directory alongside your pure Python modulesz
include-dirs=�Iz.list of directories to search for header files)zdefine=�DzC preprocessor macros to define)zundef=�Uz!C preprocessor macros to undefine)z
libraries=�lz!external C libraries to link withz
library-dirs=�Lz.directories to search for external C libraries)zrpath=�Rz7directories to search for shared C libraries at runtime)z
link-objects=�Oz2extra explicit link objects to include in the link)�debug�gz'compile/link with debugging information)�force�fz2forcibly build everything (ignore file timestamps))z	compiler=�czspecify the compiler type)z	parallel=�jznumber of parallel build jobs)�swig-cppNz)make SWIG create C++ files (default is C))z
swig-opts=Nz!list of SWIG command line options)zswig=Nzpath to the SWIG executable)�userNz#add user include, library and rpathrrr r$r%z
help-compilerNzlist available compilerscCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_dS)Nr)�
extensions�	build_lib�	plat_name�
build_tempr�package�include_dirs�define�undef�	libraries�library_dirs�rpath�link_objectsrr �compiler�swig�swig_cpp�	swig_optsr%�parallel��selfrrr�initialize_optionsjs*zbuild_ext.initialize_optionsc

Cs�ddlm}|�ddddddd	d
�|jdkr8|jj|_|jj|_|��}|jdd�}|j	dkrn|jj	pjg|_	t
|j	t�r�|j	�t
j�|_	tjtjkr�|j	�t
j�tjd
��|j	�|�t
jj��||kr�|j	�|�t
jj��|�d�|�d�|jdk�rg|_|jdk�rg|_nt
|jt��r:|j�t
j�|_|jdk�rNg|_nt
|jt��rl|j�t
j�|_t
jdk�rh|j�t
j�tjd��tjtjk�r�|j�t
j�tjd��|j�r�t
j�|jd�|_nt
j�|jd�|_|j	�t
j�t���t tdd�}|�r|j�|�|j!dk�r*d}n|j!dd�}t
j�tjd�}|�r\t
j�||�}|j�|�tj"dd�dk�r�tj#�$t
j�tjd���r�|j�t
j�tjddt%�d��n|j�d�|�&d��r�|j'�s�|j�|�&d ��n|j�d�|j(�r|j(�d!�}d"d#�|D�|_(|j)�r4|j)�d!�|_)|j*dk�rHg|_*n|j*�d$�|_*|j+�r�t
j�t,d
�}t
j�t,d�}	t
j�-|��r�|j	�|�t
j�-|	��r�|j�|	�|j�|	�t
|j.t��r�zt/|j.�|_.Wnt0k
�r�t1d%��YnXdS)&Nr)�	sysconfigZbuild)r'r')r)r))r2r2)rr)r r )r6r6)r(r(�)Z
plat_specificZincluder.r1�ntZlibsZDebugZRelease�_home�win32�ZPCbuild��cygwin�bin�lib�pythonZconfig�.�Py_ENABLE_SHAREDZLIBDIR�,cSsg|]}|df�qS)�1r)�.0Zsymbolrrr�
<listcomp>�sz.build_ext.finalize_options.<locals>.<listcomp>� zparallel should be an integer)2�	distutilsr:Zset_undefined_optionsr*�distributionZext_packageZext_modulesr&Zget_python_incr+�
isinstance�str�split�os�pathsep�sys�exec_prefix�base_exec_prefix�append�path�join�extendZensure_string_listr.r/r0�name�prefixrr)�dirnamer�getattrr(�platform�
executable�
startswithr�get_config_varZpython_buildr,r-r5r%r�isdirr6�int�
ValueErrorZDistutilsOptionError)
r8r:Z
py_includeZplat_py_includeZ	_sys_home�suffixZnew_libZdefinesZuser_includeZuser_librrr�finalize_options�s��




�

�zbuild_ext.finalize_optionscCsjddlm}|jsdS|j��rL|�d�}|j�|��p:g�|j	�
|j�||j|j
|j|jd�|_t|j�tjdkr�|jt�kr�|j�|j�|jdk	r�|j�|j�|jdk	r�|jD]\}}|j�||�q�|jdk	r�|jD]}|j�|�q�|jdk	�r|j�|j�|j	dk	�r*|j�|j	�|jdk	�rD|j�|j�|j dk	�r^|j�!|j �|�"�dS)Nr)�new_compiler�
build_clib)r2�verbose�dry_runr r<)#rrgr&rMZhas_c_libraries�get_finalized_commandr.rYZget_library_namesr/rVrhr2rirjr rrQrZr(r	Z
initializer+Zset_include_dirsr,Zdefine_macror-Zundefine_macroZ
set_librariesZset_library_dirsr0Zset_runtime_library_dirsr1Zset_link_objects�build_extensions)r8rgrhrZ�value�macrorrr�runs@

�




z
build_ext.runc
Csvt|t�std��t|�D�]T\}}t|t�r0qt|t�rFt|�dkrNtd��|\}}t�d|�t|t	�rvt
�|�s~td��t|t�s�td��t||d�}dD]"}|�
|�}|d	k	r�t|||�q�|�
d
�|_d|kr�t�d�|�
d
�}|�rhg|_g|_|D]b}	t|	t��r"t|	�dk�s*td��t|	�dk�rJ|j�|	d�nt|	�dk�r|j�|	��q|||<qd	S)a�Ensure that the list of extensions (presumably provided as a
        command option 'extensions') is valid, i.e. it is a list of
        Extension objects.  We also support the old-style list of 2-tuples,
        where the tuples are (ext_name, build_info), which are converted to
        Extension instances here.

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z:'ext_modules' option must be a list of Extension instances�zMeach element of 'ext_modules' option must be an Extension instance or 2-tuplezvold-style (ext_name, build_info) tuple found in ext_modules for extension '%s' -- please convert to Extension instancezRfirst element of each tuple in 'ext_modules' must be the extension name (a string)zOsecond element of each tuple in 'ext_modules' must be a dictionary (build info)�sources)r+r/r.�
extra_objects�extra_compile_args�extra_link_argsNr0Zdef_filez9'def_file' element of build info dict no longer supported�macros)r;rpz9'macros' element of build info dict must be 1- or 2-tupler;r)rN�list�DistutilsSetupError�	enumerater�tuple�lenr
�warnrO�extension_name_re�match�dict�get�setattr�runtime_library_dirs�
define_macros�undef_macrosrV)
r8r&r�ext�ext_nameZ
build_info�key�valrurnrrr�check_extensions_listVs^

�
��
��
�


�zbuild_ext.check_extensions_listcCs,|�|j�g}|jD]}|�|j�q|S�N)r�r&rYrq)r8�	filenamesr�rrr�get_source_files�s

zbuild_ext.get_source_filescCs2|�|j�g}|jD]}|�|�|j��q|Sr�)r�r&rV�get_ext_fullpathrZ)r8Zoutputsr�rrr�get_outputs�s

zbuild_ext.get_outputscCs(|�|j�|jr|��n|��dSr�)r�r&r6�_build_extensions_parallel�_build_extensions_serialr7rrrrl�s
zbuild_ext.build_extensionscs��j}�jdkrt��}zddlm}Wntk
r@d}YnX|dkrV���dS||d��P���fdd��jD�}t�j|�D]&\}}��	|��|�
�W5QRXq�W5QRXdS)NTr)�ThreadPoolExecutor)Zmax_workerscsg|]}���j|��qSr)Zsubmit�build_extension)rIr��Zexecutorr8rrrJ�s�z8build_ext._build_extensions_parallel.<locals>.<listcomp>)r6rQ�	cpu_countZconcurrent.futuresr��ImportErrorr�r&�zip�_filter_build_errors�result)r8Zworkersr�Zfuturesr�Zfutrr�rr��s"

�z$build_ext._build_extensions_parallelc
Cs0|jD]$}|�|��|�|�W5QRXqdSr�)r&r�r�)r8r�rrrr��s
z"build_ext._build_extensions_serialc
csTz
dVWnDtttfk
rN}z |js*�|�d|j|f�W5d}~XYnXdS)Nz"building extension "%s" failed: %s)ZCCompilerErrorZDistutilsErrorZCompileErrorZoptionalr{rZ)r8r��errrr��s
�zbuild_ext._filter_build_errorsc
CsP|j}|dkst|ttf�s*td|j��t|�}|�|j�}||j}|jslt	||d�slt
�d|j�dSt
�d|j�|�
||�}|jp�g}|jdd�}|jD]}|�|f�q�|jj||j||j|j||jd�}|dd�|_|jr�|�|j�|j�pg}|j�p|j�|�}	|jj|||�|�|j|j||� |�|j|j|	d�
dS)Nzjin 'ext_modules' option (extension '%s'), 'sources' must be present and must be a list of source filenamesZnewerz$skipping '%s' extension (up-to-date)zbuilding '%s' extension)Z
output_dirrur+r�extra_postargs�depends)r.r/r�r��export_symbolsrr)Ztarget_lang)!rqrNrvryrwrZr�r�r rr
r�info�swig_sourcesrsr�r�rVr2�compiler)r+Z_built_objectsrrrYrt�languageZdetect_languageZlink_shared_object�
get_librariesr/r��get_export_symbols)
r8r�rq�ext_pathr�Z
extra_argsrur-Zobjectsr�rrrr��sX��


�
�zbuild_ext.build_extensioncCs$g}g}i}|jrt�d�|js6d|jks6d|jkr<d}nd}|D]P}tj�|�\}}	|	dkr�|�|d|�|�|�|d||<qD|�|�qD|s�|S|jp�|�	�}
|
dg}|�
|j�|jr�|�d�|js�|jD]}|�|�q�|D].}||}
t�d	||
�|�|d
|
|g�q�|S)z�Walk the list of source files in 'sources', looking for SWIG
        interface (.i) files.  Run SWIG on all that are found, and
        return a modified 'sources' list with SWIG source files replaced
        by the generated C (or C++) files.
        z/--swig-cpp is deprecated - use --swig-opts=-c++z-c++z.cppz.cz.i�_wrap���z-pythonzswigging %s to %sz-o)
r4r
r{r5rQrW�splitextrVr3�	find_swigrYr�Zspawn)r8rq�	extensionZnew_sourcesr�Zswig_targetsZ
target_ext�source�baser�r3Zswig_cmd�o�targetrrrr�1s@
�


zbuild_ext.swig_sourcescCs^tjdkrdStjdkrLdD]*}tj�d|d�}tj�|�r|SqdStdtj��dS)	z�Return the name of the SWIG executable.  On Unix, this is
        just "swig" -- it should be in the PATH.  Tries a bit harder on
        Windows.
        �posixr3r<)z1.3z1.2z1.1z	c:\swig%szswig.exez>I don't know how to find (much less run) SWIG on platform '%s'N)rQrZrWrX�isfileZDistutilsPlatformError)r8Zvers�fnrrrr�gs


��zbuild_ext.find_swigcCs�|�|�}|�d�}|�|d�}|jsRtjj|dd�|g�}tj�|j|�Sd�|dd��}|�d�}tj�	|�
|��}tj�||�S)z�Returns the path of the filename for a given extension.

        The file is located in `build_lib` or directly in the package
        (inplace option).
        rEr�Nr�build_py)�get_ext_fullnamerP�get_ext_filenamerrQrWrXr'rk�abspathZget_package_dir)r8r��fullname�modpath�filenamer*r�Zpackage_dirrrrr�s


zbuild_ext.get_ext_fullpathcCs |jdkr|S|jd|SdS)zSReturns the fullname of a given extension name.

        Adds the `package.` prefixNrE)r*)r8r�rrrr��s
zbuild_ext.get_ext_fullnamecCs.ddlm}|�d�}|d�}tjj|�|S)z�Convert the name of an extension (eg. "foo.bar") into the name
        of the file from which it will be loaded (eg. "foo/bar.so", or
        "foo\bar.pyd").
        r�rarEZ
EXT_SUFFIX)�distutils.sysconfigrarPrQrWrX)r8r�rar�Z
ext_suffixrrrr��s
zbuild_ext.get_ext_filenamecCsxd|j�d�d}z|�d�Wn0tk
rRd|�d��dd��d�}YnXd	|}||jkrr|j�|�|jS)
aReturn the list of symbols that a shared extension has to
        export.  This either uses 'ext.export_symbols' or, if it's not
        provided, "PyInit_" + module_name.  Only relevant on Windows, where
        the .pyd file (DLL) must export the module "PyInit_" function.
        �_rEr��asciirZpunycode�-�_ZPyInit)rZrP�encode�UnicodeEncodeError�replace�decoder�rV)r8r�reZ
initfunc_namerrrr��s"
zbuild_ext.get_export_symbolscCs�tjdkr^ddlm}t|j|�s�d}|jr4|d}|tjd?tjd?d@f}|j|gSn�dd	l	m
}d
}|d�r�ttd�r�d
}n<tjdkr�d
}n,dtj
kr�|d�dkr�d
}n|d�dkr�d
}|r�|d�}|jd|gS|jS)z�Return the list of libraries to link against when building a
        shared extension.  On most platforms, this is just 'ext.libraries';
        on Windows, we add the Python library (eg. python20.dll).
        r>r)�MSVCCompilerz
python%d%dZ_d���r�FrFZgetandroidapilevelTrAZ_PYTHON_HOST_PLATFORMZANDROID_API_LEVELZMACHDEPZ	LDVERSIONrD)rSr^Zdistutils._msvccompilerr�rNr2r�
hexversionr.r�ra�hasattrrQ�environ)r8r�r��templateZ	pythonlibraZlink_libpythonZ	ldversionrrrr��s4

�



zbuild_ext.get_libraries) �__name__�
__module__�__qualname__ZdescriptionrQrRZsep_byr	Zuser_optionsZboolean_optionsr
Zhelp_optionsr9rfror�r�r�rlr�r��
contextlib�contextmanagerr�r�r�r�r�r�r�r�r�rrrrr!sp
�����+��@N	
	K6	
r)�__doc__r�rQ�rerSZdistutils.corerZdistutils.errorsr�rrrZdistutils.dep_utilrZdistutils.extensionrZdistutils.utilr	rLr
Zsiterr�r|r
rrrrr�<module>s$�__pycache__/build_ext.cpython-38.opt-1.pyc000064400000037413150513660050014333 0ustar00U

e5dP{�@s�dZddlZddlZddlZddlZddlmZddlTddlm	Z	m
Z
ddlmZddlm
Z
ddlmZdd	lmZdd
lmZddlmZe�d�Zd
d�ZGdd�de�ZdS)z�distutils.command.build_ext

Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP).�N)�Command)�*)�customize_compiler�get_python_version)�get_config_h_filename)�newer_group)�	Extension)�get_platform)�log)�	USER_BASEz3^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$cCsddlm}|�dS)Nr��show_compilers)�distutils.ccompilerr
r�r�3/usr/lib64/python3.8/distutils/command/build_ext.pyr
sr
c@seZdZdZdejZddddde�fdd	d
defdd
ddddefddddddddddgZddddd gZ	d!d"d#e
fgZd$d%�Zd&d'�Z
d(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zejd6d7��Zd8d9�Zd:d;�Zd<d=�Zd>d?�Zd@dA�ZdBdC�ZdDdE�ZdFdG�Zd"S)H�	build_extz8build C/C++ extensions (compile/link to build directory)z (separated by '%s'))z
build-lib=�bz(directory for compiled extension modules)zbuild-temp=�tz1directory for temporary files (build by-products)z
plat-name=�pz>platform name to cross-compile for, if supported (default: %s))�inplace�iziignore build-lib and put compiled extensions into the source directory alongside your pure Python modulesz
include-dirs=�Iz.list of directories to search for header files)zdefine=�DzC preprocessor macros to define)zundef=�Uz!C preprocessor macros to undefine)z
libraries=�lz!external C libraries to link withz
library-dirs=�Lz.directories to search for external C libraries)zrpath=�Rz7directories to search for shared C libraries at runtime)z
link-objects=�Oz2extra explicit link objects to include in the link)�debug�gz'compile/link with debugging information)�force�fz2forcibly build everything (ignore file timestamps))z	compiler=�czspecify the compiler type)z	parallel=�jznumber of parallel build jobs)�swig-cppNz)make SWIG create C++ files (default is C))z
swig-opts=Nz!list of SWIG command line options)zswig=Nzpath to the SWIG executable)�userNz#add user include, library and rpathrrr r$r%z
help-compilerNzlist available compilerscCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_dS)Nr)�
extensions�	build_lib�	plat_name�
build_tempr�package�include_dirs�define�undef�	libraries�library_dirs�rpath�link_objectsrr �compiler�swig�swig_cpp�	swig_optsr%�parallel��selfrrr�initialize_optionsjs*zbuild_ext.initialize_optionsc

Cs�ddlm}|�ddddddd	d
�|jdkr8|jj|_|jj|_|��}|jdd�}|j	dkrn|jj	pjg|_	t
|j	t�r�|j	�t
j�|_	tjtjkr�|j	�t
j�tjd
��|j	�|�t
jj��||kr�|j	�|�t
jj��|�d�|�d�|jdk�rg|_|jdk�rg|_nt
|jt��r:|j�t
j�|_|jdk�rNg|_nt
|jt��rl|j�t
j�|_t
jdk�rh|j�t
j�tjd��tjtjk�r�|j�t
j�tjd��|j�r�t
j�|jd�|_nt
j�|jd�|_|j	�t
j�t���t tdd�}|�r|j�|�|j!dk�r*d}n|j!dd�}t
j�tjd�}|�r\t
j�||�}|j�|�tj"dd�dk�r�tj#�$t
j�tjd���r�|j�t
j�tjddt%�d��n|j�d�|�&d��r�|j'�s�|j�|�&d ��n|j�d�|j(�r|j(�d!�}d"d#�|D�|_(|j)�r4|j)�d!�|_)|j*dk�rHg|_*n|j*�d$�|_*|j+�r�t
j�t,d
�}t
j�t,d�}	t
j�-|��r�|j	�|�t
j�-|	��r�|j�|	�|j�|	�t
|j.t��r�zt/|j.�|_.Wnt0k
�r�t1d%��YnXdS)&Nr)�	sysconfigZbuild)r'r')r)r))r2r2)rr)r r )r6r6)r(r(�)Z
plat_specificZincluder.r1�ntZlibsZDebugZRelease�_home�win32�ZPCbuild��cygwin�bin�lib�pythonZconfig�.�Py_ENABLE_SHAREDZLIBDIR�,cSsg|]}|df�qS)�1r)�.0Zsymbolrrr�
<listcomp>�sz.build_ext.finalize_options.<locals>.<listcomp>� zparallel should be an integer)2�	distutilsr:Zset_undefined_optionsr*�distributionZext_packageZext_modulesr&Zget_python_incr+�
isinstance�str�split�os�pathsep�sys�exec_prefix�base_exec_prefix�append�path�join�extendZensure_string_listr.r/r0�name�prefixrr)�dirnamer�getattrr(�platform�
executable�
startswithr�get_config_varZpython_buildr,r-r5r%r�isdirr6�int�
ValueErrorZDistutilsOptionError)
r8r:Z
py_includeZplat_py_includeZ	_sys_home�suffixZnew_libZdefinesZuser_includeZuser_librrr�finalize_options�s��




�

�zbuild_ext.finalize_optionscCsjddlm}|jsdS|j��rL|�d�}|j�|��p:g�|j	�
|j�||j|j
|j|jd�|_t|j�tjdkr�|jt�kr�|j�|j�|jdk	r�|j�|j�|jdk	r�|jD]\}}|j�||�q�|jdk	r�|jD]}|j�|�q�|jdk	�r|j�|j�|j	dk	�r*|j�|j	�|jdk	�rD|j�|j�|j dk	�r^|j�!|j �|�"�dS)Nr)�new_compiler�
build_clib)r2�verbose�dry_runr r<)#rrgr&rMZhas_c_libraries�get_finalized_commandr.rYZget_library_namesr/rVrhr2rirjr rrQrZr(r	Z
initializer+Zset_include_dirsr,Zdefine_macror-Zundefine_macroZ
set_librariesZset_library_dirsr0Zset_runtime_library_dirsr1Zset_link_objects�build_extensions)r8rgrhrZ�value�macrorrr�runs@

�




z
build_ext.runc
Csvt|t�std��t|�D�]T\}}t|t�r0qt|t�rFt|�dkrNtd��|\}}t�d|�t|t	�rvt
�|�s~td��t|t�s�td��t||d�}dD]"}|�
|�}|d	k	r�t|||�q�|�
d
�|_d|kr�t�d�|�
d
�}|�rhg|_g|_|D]b}	t|	t��r"t|	�dk�s*td��t|	�dk�rJ|j�|	d�nt|	�dk�r|j�|	��q|||<qd	S)a�Ensure that the list of extensions (presumably provided as a
        command option 'extensions') is valid, i.e. it is a list of
        Extension objects.  We also support the old-style list of 2-tuples,
        where the tuples are (ext_name, build_info), which are converted to
        Extension instances here.

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z:'ext_modules' option must be a list of Extension instances�zMeach element of 'ext_modules' option must be an Extension instance or 2-tuplezvold-style (ext_name, build_info) tuple found in ext_modules for extension '%s' -- please convert to Extension instancezRfirst element of each tuple in 'ext_modules' must be the extension name (a string)zOsecond element of each tuple in 'ext_modules' must be a dictionary (build info)�sources)r+r/r.�
extra_objects�extra_compile_args�extra_link_argsNr0Zdef_filez9'def_file' element of build info dict no longer supported�macros)r;rpz9'macros' element of build info dict must be 1- or 2-tupler;r)rN�list�DistutilsSetupError�	enumerater�tuple�lenr
�warnrO�extension_name_re�match�dict�get�setattr�runtime_library_dirs�
define_macros�undef_macrosrV)
r8r&r�ext�ext_nameZ
build_info�key�valrurnrrr�check_extensions_listVs^

�
��
��
�


�zbuild_ext.check_extensions_listcCs,|�|j�g}|jD]}|�|j�q|S�N)r�r&rYrq)r8�	filenamesr�rrr�get_source_files�s

zbuild_ext.get_source_filescCs2|�|j�g}|jD]}|�|�|j��q|Sr�)r�r&rV�get_ext_fullpathrZ)r8Zoutputsr�rrr�get_outputs�s

zbuild_ext.get_outputscCs(|�|j�|jr|��n|��dSr�)r�r&r6�_build_extensions_parallel�_build_extensions_serialr7rrrrl�s
zbuild_ext.build_extensionscs��j}�jdkrt��}zddlm}Wntk
r@d}YnX|dkrV���dS||d��P���fdd��jD�}t�j|�D]&\}}��	|��|�
�W5QRXq�W5QRXdS)NTr)�ThreadPoolExecutor)Zmax_workerscsg|]}���j|��qSr)Zsubmit�build_extension)rIr��Zexecutorr8rrrJ�s�z8build_ext._build_extensions_parallel.<locals>.<listcomp>)r6rQ�	cpu_countZconcurrent.futuresr��ImportErrorr�r&�zip�_filter_build_errors�result)r8Zworkersr�Zfuturesr�Zfutrr�rr��s"

�z$build_ext._build_extensions_parallelc
Cs0|jD]$}|�|��|�|�W5QRXqdSr�)r&r�r�)r8r�rrrr��s
z"build_ext._build_extensions_serialc
csTz
dVWnDtttfk
rN}z |js*�|�d|j|f�W5d}~XYnXdS)Nz"building extension "%s" failed: %s)ZCCompilerErrorZDistutilsErrorZCompileErrorZoptionalr{rZ)r8r��errrr��s
�zbuild_ext._filter_build_errorsc
CsP|j}|dkst|ttf�s*td|j��t|�}|�|j�}||j}|jslt	||d�slt
�d|j�dSt
�d|j�|�
||�}|jp�g}|jdd�}|jD]}|�|f�q�|jj||j||j|j||jd�}|dd�|_|jr�|�|j�|j�pg}|j�p|j�|�}	|jj|||�|�|j|j||� |�|j|j|	d�
dS)Nzjin 'ext_modules' option (extension '%s'), 'sources' must be present and must be a list of source filenamesZnewerz$skipping '%s' extension (up-to-date)zbuilding '%s' extension)Z
output_dirrur+r�extra_postargs�depends)r.r/r�r��export_symbolsrr)Ztarget_lang)!rqrNrvryrwrZr�r�r rr
r�info�swig_sourcesrsr�r�rVr2�compiler)r+Z_built_objectsrrrYrt�languageZdetect_languageZlink_shared_object�
get_librariesr/r��get_export_symbols)
r8r�rq�ext_pathr�Z
extra_argsrur-Zobjectsr�rrrr��sX��


�
�zbuild_ext.build_extensioncCs$g}g}i}|jrt�d�|js6d|jks6d|jkr<d}nd}|D]P}tj�|�\}}	|	dkr�|�|d|�|�|�|d||<qD|�|�qD|s�|S|jp�|�	�}
|
dg}|�
|j�|jr�|�d�|js�|jD]}|�|�q�|D].}||}
t�d	||
�|�|d
|
|g�q�|S)z�Walk the list of source files in 'sources', looking for SWIG
        interface (.i) files.  Run SWIG on all that are found, and
        return a modified 'sources' list with SWIG source files replaced
        by the generated C (or C++) files.
        z/--swig-cpp is deprecated - use --swig-opts=-c++z-c++z.cppz.cz.i�_wrap���z-pythonzswigging %s to %sz-o)
r4r
r{r5rQrW�splitextrVr3�	find_swigrYr�Zspawn)r8rq�	extensionZnew_sourcesr�Zswig_targetsZ
target_ext�source�baser�r3Zswig_cmd�o�targetrrrr�1s@
�


zbuild_ext.swig_sourcescCs^tjdkrdStjdkrLdD]*}tj�d|d�}tj�|�r|SqdStdtj��dS)	z�Return the name of the SWIG executable.  On Unix, this is
        just "swig" -- it should be in the PATH.  Tries a bit harder on
        Windows.
        �posixr3r<)z1.3z1.2z1.1z	c:\swig%szswig.exez>I don't know how to find (much less run) SWIG on platform '%s'N)rQrZrWrX�isfileZDistutilsPlatformError)r8Zvers�fnrrrr�gs


��zbuild_ext.find_swigcCs�|�|�}|�d�}|�|d�}|jsRtjj|dd�|g�}tj�|j|�Sd�|dd��}|�d�}tj�	|�
|��}tj�||�S)z�Returns the path of the filename for a given extension.

        The file is located in `build_lib` or directly in the package
        (inplace option).
        rEr�Nr�build_py)�get_ext_fullnamerP�get_ext_filenamerrQrWrXr'rk�abspathZget_package_dir)r8r��fullname�modpath�filenamer*r�Zpackage_dirrrrr�s


zbuild_ext.get_ext_fullpathcCs |jdkr|S|jd|SdS)zSReturns the fullname of a given extension name.

        Adds the `package.` prefixNrE)r*)r8r�rrrr��s
zbuild_ext.get_ext_fullnamecCs.ddlm}|�d�}|d�}tjj|�|S)z�Convert the name of an extension (eg. "foo.bar") into the name
        of the file from which it will be loaded (eg. "foo/bar.so", or
        "foo\bar.pyd").
        r�rarEZ
EXT_SUFFIX)�distutils.sysconfigrarPrQrWrX)r8r�rar�Z
ext_suffixrrrr��s
zbuild_ext.get_ext_filenamecCsxd|j�d�d}z|�d�Wn0tk
rRd|�d��dd��d�}YnXd	|}||jkrr|j�|�|jS)
aReturn the list of symbols that a shared extension has to
        export.  This either uses 'ext.export_symbols' or, if it's not
        provided, "PyInit_" + module_name.  Only relevant on Windows, where
        the .pyd file (DLL) must export the module "PyInit_" function.
        �_rEr��asciirZpunycode�-�_ZPyInit)rZrP�encode�UnicodeEncodeError�replace�decoder�rV)r8r�reZ
initfunc_namerrrr��s"
zbuild_ext.get_export_symbolscCs�tjdkr^ddlm}t|j|�s�d}|jr4|d}|tjd?tjd?d@f}|j|gSn�dd	l	m
}d
}|d�r�ttd�r�d
}n<tjdkr�d
}n,dtj
kr�|d�dkr�d
}n|d�dkr�d
}|r�|d�}|jd|gS|jS)z�Return the list of libraries to link against when building a
        shared extension.  On most platforms, this is just 'ext.libraries';
        on Windows, we add the Python library (eg. python20.dll).
        r>r)�MSVCCompilerz
python%d%dZ_d���r�FrFZgetandroidapilevelTrAZ_PYTHON_HOST_PLATFORMZANDROID_API_LEVELZMACHDEPZ	LDVERSIONrD)rSr^Zdistutils._msvccompilerr�rNr2r�
hexversionr.r�ra�hasattrrQ�environ)r8r�r��templateZ	pythonlibraZlink_libpythonZ	ldversionrrrr��s4

�



zbuild_ext.get_libraries) �__name__�
__module__�__qualname__ZdescriptionrQrRZsep_byr	Zuser_optionsZboolean_optionsr
Zhelp_optionsr9rfror�r�r�rlr�r��
contextlib�contextmanagerr�r�r�r�r�r�r�r�r�rrrrr!sp
�����+��@N	
	K6	
r)�__doc__r�rQ�rerSZdistutils.corerZdistutils.errorsr�rrrZdistutils.dep_utilrZdistutils.extensionrZdistutils.utilr	rLr
Zsiterr�r|r
rrrrr�<module>s$�__pycache__/bdist_msi.cpython-38.opt-1.pyc000064400000046121150513660050014325 0ustar00U

e5d߉�@s�dZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZddlZdd
lmZmZmZddlmZmZmZmZGdd
�d
e�ZGdd�de�ZdS)z#
Implements the bdist_msi command.
�N)�Command)�remove_tree)�get_python_version)�
StrictVersion)�DistutilsOptionError)�get_platform)�log)�schema�sequence�text)�	Directory�Feature�Dialog�add_datac@sFeZdZdZdd�Zdd�Zddd	�Zddd�Zddd�Zdd�Z	dS)�PyDialogz�Dialog class with a fixed layout: controls at the top, then a ruler,
    then a list of buttons: back, next, cancel. Optionally a bitmap at the
    left.cOs>tj|f|��|jd}d|d}|�dd||jd�dS)zbDialog(database, name, x, y, w, h, attributes, title, first,
        default, cancel, bitmap=true)�$�iHZ
BottomLinerN)r�__init__�h�line�w)�self�args�kwZrulerZbmwidth�r�3/usr/lib64/python3.8/distutils/command/bdist_msi.pyrs
zPyDialog.__init__c
Cs|�ddddddd|�dS)	z,Set the title text of the dialog at the top.�Title��
�@�<�z{\VerdanaBold10}%sN)r)r�titlerrrr"#s�zPyDialog.title�Back�c
Cs,|r
d}nd}|�|d|jddd|||�S)z�Add a back button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associated�r$���8���
pushbuttonr�rr"�next�name�active�flagsrrr�back*sz
PyDialog.back�Cancelc
Cs,|r
d}nd}|�|d|jddd|||�S)z�Add a cancel button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr%r$i0r'r(r)r*r,rrr�cancel5szPyDialog.cancel�Nextc
Cs,|r
d}nd}|�|d|jddd|||�S)z�Add a Next button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr%r$��r'r(r)r*r,rrrr-@sz
PyDialog.nextc
Cs,|�|t|j|d�|jdddd||�S)z�Add a button with a given title, the tab-next button,
        its name in the Control table, giving its x position; the
        y-position is aligned with the other buttons.

        Return the button, so that events can be associated�r'r(r)r%)r+�intrr)rr.r"r-Zxposrrr�xbuttonKszPyDialog.xbuttonN)r#r$)r2r$)r4r$)
�__name__�
__module__�__qualname__�__doc__rr"r1r3r-r8rrrrrs



rc@s�eZdZdZdddde�fdddd	d
ddd
g
ZddddgZddddddddddddddd d!d"d#d$d%gZd&Zd'd(�Z	d)d*�Z
d+d,�Zd-d.�Zd/d0�Z
d1d2�Zd3d4�Zd5d6�Zd7S)8�	bdist_msiz7create a Microsoft Installer (.msi) binary distribution)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)�no-target-compile�cz/do not compile .py to .pyc on the target system)�no-target-optimize�oz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=�dz-directory to put final built distributions in)�
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distributionr?rArCrFz2.0z2.1z2.2z2.3z2.4z2.5z2.6z2.7z2.8z2.9z3.0z3.1z3.2z3.3z3.4z3.5z3.6z3.7z3.8z3.9�XcCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)Nr)�	bdist_dir�	plat_name�	keep_tempZno_target_compileZno_target_optimize�target_version�dist_dir�
skip_build�install_script�pre_install_script�versions)rrrr�initialize_options}szbdist_msi.initialize_optionscCs�|�dd�|jdkr2|�d�j}tj�|d�|_t�}|jsN|j	�
�rN||_|jr�|jg|_|js�|j	�
�r�|j|kr�t
d|f��nt|j�|_|�ddd�|jr�t
d��|jr�|j	jD]}|jtj�|�kr�q�q�t
d|j��d|_dS)	NZbdist)rMrMZmsizMtarget version can only be %s, or the '--skip-build' option must be specified)rLrL)rIrIz5the pre-install-script feature is not yet implementedz(install_script '%s' not found in scripts)Zset_undefined_optionsrH�get_finalized_command�
bdist_base�os�path�joinrrK�distribution�has_ext_modulesrPrMr�list�all_versionsrOrNZscripts�basename�install_script_key)rrSZ
short_versionZscriptrrr�finalize_options�sH

�������zbdist_msi.finalize_optionscCsz|js|�d�|jddd�}|j|_|j|_d|_|�d�}d|_d|_|j�	�r�|j
}|spdtjdd�}d	|j
|f}|�d�}tj�|jd
|�|_t�d|j�|��tj�dtj�|jd��|��tjd=|�|j�|j��}|�|�}tj�|�}tj�|��r"t�|�|jj }|j!}	|	�s<|j"}	|	�sFd
}	|�#�}
dt$|
�j%}|j��}|j
�r~d|j
|f}nd|}t&�'|t(|t&�)�||	�|_*t&�+|j*t,�d|
fg}
|j-�p�|j.}|�r�|
�/d|f�|j0�r�|
�/d|j0f�|
�rt1|j*d|
�|�2�|�3�|�4�|�5�|j*�6�t7|jd��r^d|j
�pJd|f}|jj8�/|�|j9�svt:|j|j;d�dS)N�build�installr$)Zreinit_subcommandsr�install_libz%d.%d�z.%s-%s�libzinstalling to %sZPURELIBZUNKNOWNz%d.%d.%dzPython %s %sz	Python %sZDistVersionZ
ARPCONTACTZARPURLINFOABOUT�Property�
dist_filesr=�any)�dry_run)<rMZrun_commandZreinitialize_commandrH�prefixZwarn_dir�compile�optimizerWrXrK�sys�version_inforIrRrTrUrVZ
build_baseZ	build_libr�infoZensure_finalized�insert�runZmkpathrL�get_fullname�get_installer_filename�abspath�exists�unlink�metadata�authorZ
maintainerZget_versionr�version�msilibZ
init_databaser	Zgen_uuid�dbZ
add_tablesr
Zauthor_emailZmaintainer_email�appendZurlr�add_find_python�	add_files�add_scripts�add_ui�Commit�hasattrrdrJrrf)rr_r`rKZplat_specifierr^�fullname�installer_namertrurvZsversionZproduct_nameZpropsZemail�tuprrrrn�s�




�



�

z
bdist_msi.runc
Cs|j}t�d�}tj�|j�}t||d|dd�}t|ddddddd�}||d	fg}|j	|j
gD]t}d|}d|}	}
d}||j
kr�d
}d}
nd|}d}
t||	||d|
|d�}t||||||
�}|�|||f�q`|��i}|D�]\}}}|g}|�r�|�
�}t�|j�D]�}tj�|j|�}tj�|��rld
|�|�|f}||}
t|||||
|�}|�|�n�|j�s�|�|j|d�||k�r�|�|�}||<||jk�r�|j�r�td|��d||_n*||}t|jd|||j|d|jfg��qq�|��q�|�|�dS)NZ	distfiles�	TARGETDIRZ	SourceDir�PythonZ
Everythingrr$)Z	directory�zPython from another locationrazPython %s from registryz%s|%szMultiple files with name %sz[#%s]Z
DuplicateFile)rxrwZCABrTrUrqrHrr
rP�
other_versionryr~�pop�listdirZabsoluterV�isdirZ
make_shortZ	componentZstart_componentZlogicalZadd_filerNr\rrZcommit)rrxZcabZrootdir�root�f�itemsrv�targetr.�defaultZdescr"�level�dir�seenZfeatureZtodo�fileZafileZshortZnewdir�keyrrrr{
sf

�

��

zbdist_msi.add_filescCs|d}|jD�]j}d|}d|}d|}d|}d|}d|}d|}	d	|}
d
|}d|}tjrld}
nd
}
t|jd|d
|d|
f|d|d|
fg�t|jd||f||fg�t|jd|d|d|df|	d|d|df|
d|d|dfg�t|jd|||f|	||df|
d|d
fg�t|jd|||f|	||df|
d|d
fg�t|jdd|dd|fg�|d7}q
dS)asAdds code to the installer to compute the location of Python.

        Properties PYTHON.MACHINE.X.Y and PYTHON.USER.X.Y will be set from the
        registry for each version of Python.

        Properties TARGETDIRX.Y will be set from PYTHON.USER.X.Y if defined,
        else from PYTHON.MACHINE.X.Y.

        Properties PYTHONX.Y will be set to TARGETDIRX.Y\python.exei�z)SOFTWARE\Python\PythonCore\%s\InstallPathzpython.machine.zpython.user.zPYTHON.MACHINE.zPYTHON.USER.ZPythonFromMachineZPythonFromUserZ	PythonExer��PYTHON�raZ
RegLocatorNr$Z	AppSearch�CustomActioni3�[�]z]\python.exe�InstallExecuteSequence�InstallUISequenceZ	Conditionr�rz
NOT TARGETDIR�)rPrwZWin64rrx)r�start�verZinstall_pathZmachine_regZuser_regZmachine_propZ	user_propZmachine_actionZuser_actionZ
exe_actionZtarget_dir_prop�exe_propZTyperrrrzCs`�����������zbdist_msi.add_find_pythonc
Cs|jrjd}|j|jgD]P}d|}d|}t|jd|d||jfg�t|jd|d||fg�|d7}q|jr�tj�	|j
d	�}t|d
��4}|�d�t|j��}|�|�
��W5QRXW5QRXt|jdd
t�|�fg�t|jddg�t|jddg�dS)Ni�zinstall_script.r�r��2r�z&Python%s=3r$zpreinstall.batrzrem ="""
%1 %0
exit
"""
�Binary�
PreInstall)r�rar�N)r�z
NOT Installedi�)rNrPr�rrxr\rOrTrUrVrH�open�write�readrwr�)rr�r�Zinstall_actionr�Zscriptfnr�Zfinrrrr|ys6��
	
"���zbdist_msi.add_scriptscCs�
|j}d}}d}d}d}d}d}d}	t|dd	d
ddd
dg�t|dddddg�t|ddddddg�t|dtj�t|dtj�t|d||||||ddd�}
|
�d�|
jddd d!�|
jd"d#d d!�|
�d$d%d&d'd(d)d*�|
�d+d%d,d'd-d)d.�|
j	dd"dd/�}|�
d0d1�t|d2||||||ddd�}|�d3�|jddd d!�|jd"d#d d!�|�d$d%d&d'd(d)d4�|�d+d%d,d'd-d)d.�|j	dd"dd/�}|�
d0d1�t|d5||||||ddd�}
|
�d6�|
jddd d!�|
jd"d#d d!�|
�d7d%d8d'd-d)d.�|
j	dd"dd/�}|�
d0d9�t|d:||||d;|d<d<d<d=d>�}|�d?d%d@dAd%d)dB�|�d7d-dCdDd-d)dE�|�dFd-dGdHdddI�|�dJdKd-dLdHdMdNdOddd�|jd1dPd1d/�}|�
d0d1�|j	dPd<dPd/�}|�
d0dP�|jd<d1d<d/�}|�
d0d<�t|dQddRdHdSdT|dUdd�}|�dUddVdDdWddX�|�
dYdZd[d\d]dd^d��
d0d_�|�
d`dad[d\d]ddbd��
d0dc�|�
ddd d[d\d]dded��
d0df�|�
dgdhd[d\d]dd"d��
d0di�|�
djd\d[d\d]ddPd��
d0dk�|�
dldmd[d\d]ddnd��
d0do�|�
dpdqd[d\d]dd<d��
d0dr�t|dsddRdtdud|d^d^d^�}|�dFdWd%dvdwddx�|�
dbd[dydzd{ddbd^�}|�
d0d1�|�
d^d|dydzd{dd^db�}|�
d0d9�t|d}ddRdtdu||d9d9d9�}|�dFdWd%dvdwdd~�|�
d9ddydzd{dd9d�}|�
d0d1�t|d�||||||d"d"d"�}|�d7d%d&d'd�d)d��|�d��|�dd%d�d'd-d)d��}|�ddF�|�d�d%d�d'dwd)d�}|�d�dF�|jd#dd d!�|j	d�dd d!�|�d"d�}|�
d�ds�t|d�||||||d�d�d"�}|�d��|�d�d%dwdd-dd�|j���|jddd d!�|�	d�d"�}d}|j
d�d�|d��|j|jgD](}|d7}|j
d�d�|d�||d���q
|j
d�d}|dd��|j
d0d9|d�d��|�d"d��}|�
d�ds�|�d�d�d%d�ddZdd�dd�d�}|�
d�d��|j}d�|}d�|}|�d�d%dAdd%dd��}|�d�|�|�d�|�|�d�|�|�d�|�|�d�d�d%d�dd�dd�|dd�d�}|�d�|�|�d�|�|�d�|�|�d�|�t|d�||||||d�d�d�d=d>�}|�d?d%d@dAd%d)d��|�d7d-d-dDd-d)d��|�dFd-d�dHd�dd��|�d�d�d-d�dHd�d�dd�dd�|�d�dndd���
d0d9�t|d�||||||d�d�d"�}|�d��|�d�d%d�dtddd�dXd��	}|�d�d d�d�d-d��|�d�d d�d�d-d��|jd#dd d!�|�	d�d"�}|�
d�d�d�d�|j
d0d9d�d��|�d"d��}|�
d�ds�t|d�||||||d"d"d"d=d>�}|�d?d-d%dAd%d)d��|�dFd�d�ddwddġ|�d�d�d�d�d-ddơ|�dd&d�|d&d-dd��}|�ddF�|�d�d�d�dZddRd�dd�dd�}|�d�dˡ|jdd�d=d!�|j	d�d"d=d!�|�d"d#��
d�ds�t|d�||||||d�d�d"�}|�d͡|�d�d%d�dHdhddС|�d�d%d�dHd�dd�dXd��	}|�d�d d�dAd{d֡|�d�d d�dAd{d١|jddd=d!�|�	dd"�}|�
d�d�d�d��|�
d�d�d�d@�|�
d�d�d�dN�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d0d9d�d-�|�d"dѡ�
d�ds�dS)�Nr�iri,z[ProductName] Setupr%r$� rc)Z
DefaultUIFont�DlgFont8)ZErrorDialog�ErrorDlg)Z	Progress1ZInstall)Z	Progress2Zinstalls)�MaintenanceForm_Action�Repair)�
WhichUsers�ALLZ	TextStyle)r��Tahoma�	Nr)ZDlgFontBold8r��Nr$)Z
VerdanaBold10�VerdanarNr$)ZVerdanaRed9r�r��rr�)�
PrepareDlgz(Not Privileged or Windows9x or Installed�)�
WhichUsersDlgz.Privileged and not Windows9x and not Installed�)�SelectFeaturesDlgz
Not Installedi�)�MaintenanceTypeDlgz,Installed AND NOT RESUME AND NOT Preselectedi�)�ProgressDlgNi�
ActionText�UITextZ
FatalErrorZFinishz)[ProductName] Installer ended prematurelyz< Backr)r/r2r#ZDescription1r�Fr�Pr!z�[ProductName] setup ended prematurely because of an error.  Your system has not been modified.  To install this program at a later time, please run the installation again.ZDescription2��z.Click the Finish button to exit the Installer.)r.Z	EndDialogZExitZUserExitz'[ProductName] Installer was interruptedz�[ProductName] setup was interrupted.  Your system has not been modified.  To install this program at a later time, please run the installation again.Z
ExitDialogz&Completing the [ProductName] InstallerZDescription��ZReturnZ
FilesInUse�ZRetryF)Zbitmapr���z{\DlgFontBold8}Files in Use�iz8Some files that need to be updated are currently in use.ZText�7iJz�The following applications are using files that need to be updated by this setup. Close these applications and then click Retry to continue the installation or Cancel to exit it.ZListZListBox�k��ZFileInUseProcess�Ignorer�r�eiZ	ErrorTextr��0r��N�x�H�Q�ZNoZErrorNo�Y��ZYesZErrorYes�AZAbortZ
ErrorAbort�C�*ZErrorCancel�IZErrorIgnore�O�ZOkZErrorOk�R��Z
ErrorRetryZ	CancelDlgi�U���z;Are you sure you want to cancel [ProductName] installation?�9r(r)�ZWaitForCostingDlgzRPlease wait while the installer finishes determining your disk space requirements.�fr��(zOPlease wait while the Installer prepares to guide you through the installation.z&Welcome to the [ProductName] Installer�nzPondering...Z
ActionData�r4ZSpawnDialogr�zSelect Python InstallationsZHintz9Select the Python locations where %s should be installed.zNext >z[TARGETDIR]z[SourceDir])Zorderingz
[TARGETDIR%s]z FEATURE_SELECTED AND &Python%s=3ZSpawnWaitDialograZFeaturesZ
SelectionTreer ZFEATUREZPathEditz[FEATURE_SELECTED]�1z!FEATURE_SELECTED AND &Python%s<>3ZOtherz$Provide an alternate Python locationZEnableZShowZDisableZHide���r�ZDiskCostDlgZOKz&{\DlgFontBold8}Disk Space RequirementszFThe disk space required for the installation of the selected features.�5aThe highlighted volumes (if any) do not have enough disk space available for the currently selected features.  You can either remove some files from the highlighted volumes, or choose to install less features onto local drive(s), or select different destination drive(s).Z
VolumeListZVolumeCostList�d�iz{120}{70}{70}{70}{70}g�?r�ZAdminInstallzGSelect whether to install [ProductName] for all users of this computer.r�r��zInstall for all usersZJUSTME�zInstall just for mez
[ALLUSERS]zWhichUsers="ALL"r�z({\DlgFontBold8}[Progress1] [ProductName]�#�AzYPlease wait while the Installer [Progress2] [ProductName]. This may take several minutes.ZStatusLabelzStatus:ZProgressBariz
Progress doneZSetProgressZProgressr�z)Welcome to the [ProductName] Setup WizardZBodyText�?z:Select whether you want to repair or remove [ProductName].ZRepairRadioGroup�lr�r�r�z&Repair [ProductName]ZRemoverzRe&move [ProductName]z[REINSTALL]zMaintenanceForm_Action="Repair"z[Progress1]Z	Repairingz[Progress2]ZrepairsZ	Reinstallr�z[REMOVE]zMaintenanceForm_Action="Remove"�ZRemoving�Zremoves�
�z MaintenanceForm_Action<>"Change")rxrrr�r�rr"r1r3r-ZeventZcontrolrr+�mappingrWrorPr�Z	conditionr8Z
radiogroup�add)rrx�x�yrrr"ZmodalZmodelessZtrack_disk_spaceZfatalrBZ	user_exitZexit_dialogZinuse�errorr3ZcostingZprepZseldlg�orderrvr�Zinstall_other_condZdont_install_other_condZcostZ
whichusers�gZprogressZmaintrrrr}�sv��
��	��
�
���
���
�������       ������
�
���
��������
�
������
��zbdist_msi.add_uicCs<|jrd||j|jf}nd||jf}tj�|j|�}|S)Nz%s.%s-py%s.msiz	%s.%s.msi)rKrIrTrUrVrL)rr�Z	base_namer�rrrrp�s�z bdist_msi.get_installer_filenameN)r9r:r;ZdescriptionrZuser_optionsZboolean_optionsrZr�rQr]rnr{rzr|r}rprrrrr=Ss^����
�
([66&@r=)r<rjrTZdistutils.corerZdistutils.dir_utilrZdistutils.sysconfigrZdistutils.versionrZdistutils.errorsrZdistutils.utilrZ	distutilsrrwr	r
rrr
rrrr=rrrr�<module>s>__pycache__/sdist.cpython-38.pyc000064400000034266150513660050012546 0ustar00U

e5d=J�@s�dZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZmZdd�ZGdd�de�ZdS)zadistutils.command.sdist

Implements the Distutils 'sdist' command (create a source distribution).�N)�glob)�warn)�Command)�dir_util)�	file_util)�archive_util)�TextFile)�FileList)�log)�convert_path)�DistutilsTemplateError�DistutilsOptionErrorcCs`ddlm}ddlm}g}|��D] }|�d|d||df�q$|��||��d�dS)zoPrint all possible values for the 'formats' option (used by
    the "--help-formats" command-line option).
    r)�FancyGetopt)�ARCHIVE_FORMATS�formats=N�z.List of available source distribution formats:)Zdistutils.fancy_getoptrZdistutils.archive_utilr�keys�append�sortZ
print_help)rr�formats�format�r�//usr/lib64/python3.8/distutils/command/sdist.py�show_formatss
��rc@s"eZdZdZdd�Zdddddd	d
ddd
ddddgZddddddgZdddefgZddd�Z	defgZ
dZdd�Zd d!�Z
d"d#�Zd$d%�Zd&d'�Zd(d)�Zed*d+��Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Zd@dA�ZdBdC�ZdDdE�Z dFdG�Z!dHdI�Z"dS)J�sdistz6create a source distribution (tarball, zip file, etc.)cCs|jS)zYCallable used for the check sub-command.

        Placed here so user_options can view it)�metadata_check��selfrrr�checking_metadata(szsdist.checking_metadata)z	template=�tz5name of manifest template file [default: MANIFEST.in])z	manifest=�mz)name of manifest file [default: MANIFEST])�use-defaultsNzRinclude the default file set in the manifest [default; disable with --no-defaults])�no-defaultsNz"don't include the default file set)�pruneNz�specifically exclude files/directories that should not be distributed (build tree, RCS/CVS dirs, etc.) [default; disable with --no-prune])�no-pruneNz$don't automatically exclude anything)�
manifest-only�ozEjust regenerate the manifest and then stop (implies --force-manifest))�force-manifest�fzkforcibly regenerate the manifest and carry on as usual. Deprecated: now the manifest is always regenerated.)rNz6formats for source distribution (comma-separated list))�	keep-temp�kz@keep the distribution tree around after creating archive file(s))z	dist-dir=�dzFdirectory to put the source distribution archive(s) in [default: dist])�metadata-checkNz[Ensure that all required elements of meta-data are supplied. Warn if any missing. [default])zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]r!r#r%r'r)r,zhelp-formatsNz#list available distribution formats)r"r$�check)ZREADMEz
README.txtz
README.rstcCsTd|_d|_d|_d|_d|_d|_dg|_d|_d|_d|_	d|_
d|_d|_dS)N�rZgztar)
�template�manifest�use_defaultsr#�
manifest_onlyZforce_manifestr�	keep_temp�dist_dir�
archive_filesr�owner�grouprrrr�initialize_optionseszsdist.initialize_optionscCsZ|jdkrd|_|jdkr d|_|�d�t�|j�}|rFtd|��|jdkrVd|_dS)NZMANIFESTzMANIFEST.inrzunknown archive format '%s'Zdist)r2r1Zensure_string_listrZcheck_archive_formatsrr
r6)rZ
bad_formatrrr�finalize_options|s


�
zsdist.finalize_optionscCs>t�|_|��D]}|�|�q|��|jr2dS|��dS�N)r	�filelistZget_sub_commandsZrun_command�
get_file_listr4�make_distribution)rZcmd_namerrr�run�sz	sdist.runcCs*tdt�|j�d�}|��|��dS)zDeprecated API.zadistutils.command.sdist.check_metadata is deprecated,               use the check command insteadr/N)r�PendingDeprecationWarning�distributionZget_command_objZensure_finalizedr@)rr/rrr�check_metadata�s�zsdist.check_metadatacCs�tj�|j�}|s:|��r:|��|j��|j��dS|sN|�	d|j�|j�
�|jrf|��|rr|�
�|jr�|��|j��|j��|��dS)aCFigure out the list of files to include in the source
        distribution, and put it in 'self.filelist'.  This might involve
        reading the manifest template (and writing the manifest), or just
        reading the manifest, or just using the default file set -- it all
        depends on the user's options.
        Nz?manifest template '%s' does not exist (using default file list))�os�path�isfiler1�_manifest_is_not_generated�
read_manifestr=rZremove_duplicatesr�findallr3�add_defaults�
read_templater#�prune_file_list�write_manifest)rZtemplate_existsrrrr>�s(

�


zsdist.get_file_listcCs<|��|��|��|��|��|��|��dS)a9Add all the default files to self.filelist:
          - README or README.txt
          - setup.py
          - test/test*.py
          - all pure Python modules mentioned in setup script
          - all files pointed by package_data (build_py)
          - all files defined in data_files.
          - all files defined as scripts.
          - all C sources listed as part of extensions or C libraries
            in the setup script (doesn't catch C headers!)
        Warns if (README or README.txt) or setup.py are missing; everything
        else is optional.
        N)�_add_defaults_standards�_add_defaults_optional�_add_defaults_python�_add_defaults_data_files�_add_defaults_ext�_add_defaults_c_libs�_add_defaults_scriptsrrrrrJ�szsdist.add_defaultscCs:tj�|�sdStj�|�}tj�|�\}}|t�|�kS)z�
        Case-sensitive path existence check

        >>> sdist._cs_path_exists(__file__)
        True
        >>> sdist._cs_path_exists(__file__.upper())
        False
        F)rDrE�exists�abspath�split�listdir)�fspathrVZ	directory�filenamerrr�_cs_path_exists�s

zsdist._cs_path_existscCs�|j|jjg}|D]~}t|t�rj|}d}|D]"}|�|�r,d}|j�|�qPq,|s�|�dd�	|��q|�|�r�|j�|�q|�d|�qdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found)
�READMESrBZscript_name�
isinstance�tupler[r=rr�join)rZ	standards�fnZaltsZgot_itrrrrN�s"

�
zsdist._add_defaults_standardscCs4ddg}|D]"}ttjjt|��}|j�|�qdS)Nz
test/test*.pyz	setup.cfg)�filterrDrErFrr=�extend)rZoptional�pattern�filesrrrrOszsdist._add_defaults_optionalcCs\|�d�}|j��r$|j�|���|jD],\}}}}|D]}|j�tj	�
||��q:q*dS)N�build_py)�get_finalized_commandrBZhas_pure_modulesr=rb�get_source_files�
data_filesrrDrEr_)rreZpkgZsrc_dirZ	build_dir�	filenamesrZrrrrPs

zsdist._add_defaults_pythoncCsz|j��rv|jjD]b}t|t�rBt|�}tj�|�rt|j	�
|�q|\}}|D]$}t|�}tj�|�rN|j	�
|�qNqdSr<)rBZhas_data_filesrhr]�strrrDrErFr=r)r�item�dirnamerir(rrrrQ$s

zsdist._add_defaults_data_filescCs(|j��r$|�d�}|j�|���dS)N�	build_ext)rBZhas_ext_modulesrfr=rbrg)rrmrrrrR5s

zsdist._add_defaults_extcCs(|j��r$|�d�}|j�|���dS)N�
build_clib)rBZhas_c_librariesrfr=rbrg)rrnrrrrS:s

zsdist._add_defaults_c_libscCs(|j��r$|�d�}|j�|���dS)N�
build_scripts)rBZhas_scriptsrfr=rbrg)rrorrrrT?s

zsdist._add_defaults_scriptsc
Cs�t�d|j�t|jddddddd�}zh|��}|dkr:q�z|j�|�Wq(tt	fk
r�}z|�
d|j|j|f�W5d}~XYq(Xq(W5|��XdS)z�Read and parse manifest template file named by self.template.

        (usually "MANIFEST.in") The parsing and processing is done by
        'self.filelist', which updates itself accordingly.
        zreading manifest template '%s'r0)Zstrip_commentsZskip_blanksZ
join_linesZ	lstrip_wsZ	rstrip_wsZ
collapse_joinNz%s, line %d: %s)
r
�infor1r�close�readliner=Zprocess_template_liner�
ValueErrorrrZZcurrent_line)rr1�line�msgrrrrKDs&
�
� zsdist.read_templatecCs�|�d�}|j��}|jjd|jd�|jjd|d�tjdkrFd}nd}ddd	d
ddd
g}d|d�|�|f}|jj|dd�dS)avPrune off branches that might slip into the file list as created
        by 'read_template()', but really don't belong there:
          * the build tree (typically "build")
          * the release tree itself (only an issue if we ran "sdist"
            previously with --keep-temp, or it aborted)
          * any RCS, CVS, .svn, .hg, .git, .bzr, _darcs directories
        �buildN)�prefixZwin32z/|\\�/ZRCSZCVSz\.svnz\.hgz\.gitz\.bzrZ_darcsz(^|%s)(%s)(%s).*�|r0)Zis_regex)	rfrB�get_fullnamer=Zexclude_patternZ
build_base�sys�platformr_)rrv�base_dirZsepsZvcs_dirsZvcs_ptrnrrrrLas


�zsdist.prune_file_listcCsX|��rt�d|j�dS|jjdd�}|�dd�|�tj	|j|fd|j�dS)z�Write the file list in 'self.filelist' (presumably as filled in
        by 'add_defaults()' and 'read_template()') to the manifest file
        named by 'self.manifest'.
        z5not writing to manually maintained manifest file '%s'Nrz*# file GENERATED by distutils, do NOT editzwriting manifest file '%s')
rGr
rpr2r=rd�insertZexecuterZ
write_file)rZcontentrrrrMys��zsdist.write_manifestcCs<tj�|j�sdSt|j�}z|��}W5|��X|dkS)NFz+# file GENERATED by distutils, do NOT edit
)rDrErFr2�openrqrr)r�fpZ
first_linerrrrG�s

z sdist._manifest_is_not_generatedc	CsVt�d|j�t|j��4}|D](}|��}|�d�s|s:q|j�|�qW5QRXdS)z�Read the manifest file (named by 'self.manifest') and use it to
        fill in 'self.filelist', the list of files to include in the source
        distribution.
        zreading manifest file '%s'�#N)r
rpr2r�strip�
startswithr=r)rr2rtrrrrH�szsdist.read_manifestcCs�|�|�tj|||jd�ttd�r4d}d|}nd}d|}|sPt�d�n
t�|�|D]<}tj	�
|�s|t�d|�q^tj	�||�}|j|||d	�q^|j
j�|�dS)
a�Create the directory tree that will become the source
        distribution archive.  All directories implied by the filenames in
        'files' are created under 'base_dir', and then we hard link or copy
        (if hard linking is unavailable) those files into place.
        Essentially, this duplicates the developer's source tree, but in a
        directory named after the distribution, containing only the files
        to be distributed.
        ��dry_run�linkZhardzmaking hard links in %s...Nzcopying files to %s...z)no files to distribute -- empty manifest?z#'%s' not a regular file -- skipping)r�)ZmkpathrZcreate_treer��hasattrrDr
rrprErFr_Z	copy_filerBZmetadataZwrite_pkg_info)rr}rdr�ru�file�destrrr�make_release_tree�s 
	


zsdist.make_release_treecCs�|j��}tj�|j|�}|�||jj�g}d|j	krT|j	�
|j	�|j	�d���|j	D]:}|j
||||j|jd�}|�
|�|jj�
dd|f�qZ||_|js�tj||jd�dS)a�Create the source distribution(s).  First, we create the release
        tree with 'make_release_tree()'; then, we create all required
        archive files (according to 'self.formats') from the release tree.
        Finally, we clean up by blowing away the release tree (unless
        'self.keep_temp' is true).  The list of archive files created is
        stored so it can be retrieved later by 'get_archive_files()'.
        Ztar)r}r8r9r�r�N)rBrzrDrEr_r6r�r=rdrr�pop�indexZmake_archiver8r9Z
dist_filesr7r5rZremove_treer�)rr}Z	base_namer7Zfmtr�rrrr?�s 




�
zsdist.make_distributioncCs|jS)zzReturn the list of archive files created when the command
        was run, or None if the command hasn't run yet.
        )r7rrrr�get_archive_files�szsdist.get_archive_files)#�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsZnegative_optZsub_commandsr\r:r;r@rCr>rJ�staticmethodr[rNrOrPrQrRrSrTrKrLrMrGrHr�r?r�rrrrr$sp�'����
(
*r)�__doc__rDr{r�warningsrZdistutils.corerZ	distutilsrrrZdistutils.text_filerZdistutils.filelistr	r
Zdistutils.utilrZdistutils.errorsrr
rrrrrr�<module>s__pycache__/build_clib.cpython-38.opt-2.pyc000064400000010246150513660050014440 0ustar00U

e5dV�@sPddlZddlmZddlTddlmZddlmZdd�ZGdd	�d	e�Z	dS)
�N)�Command)�*)�customize_compiler)�logcCsddlm}|�dS)Nr��show_compilers)�distutils.ccompilerrr�r	�4/usr/lib64/python3.8/distutils/command/build_clib.pyrsrc@sleZdZdZdddddgZddgZd	d
defgZdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zd
S)�
build_clibz/build C/C++ libraries used by Python extensions)zbuild-clib=�bz%directory to build C/C++ libraries to)zbuild-temp=�tz,directory to put temporary build by-products)�debug�gz"compile with debugging information)�force�fz2forcibly build everything (ignore file timestamps))z	compiler=�czspecify the compiler typerrz
help-compilerNzlist available compilerscCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	r�
build_temp�	libraries�include_dirs�define�undefrr�compiler��selfr	r	r
�initialize_options4szbuild_clib.initialize_optionscCsh|�dddddd�|jj|_|jr0|�|j�|jdkrH|jjpDg|_t|jt�rd|j�tj	�|_dS)NZbuild)rr)rr)rr)rr)rr)
Zset_undefined_optionsZdistributionr�check_library_listr�
isinstance�str�split�os�pathseprr	r	r
�finalize_optionsDs�

zbuild_clib.finalize_optionscCs�|js
dSddlm}||j|j|jd�|_t|j�|jdk	rN|j�|j�|j	dk	rv|j	D]\}}|j�
||�q^|jdk	r�|jD]}|j�|�q�|�
|j�dS)Nr)�new_compiler)r�dry_runr)rrr#rr$rrrZset_include_dirsrZdefine_macrorZundefine_macro�build_libraries)rr#�name�valueZmacror	r	r
�run^s"�




zbuild_clib.runcCs�t|t�std��|D]z}t|t�s8t|�dkr8td��|\}}t|t�sRtd��d|ksntjdkr~tj|kr~td|d��t|t�std��qdS)	Nz+'libraries' option must be a list of tuples�z*each element of 'libraries' must a 2-tuplezNfirst element of each tuple in 'libraries' must be a string (the library name)�/z;bad library name '%s': may not contain directory separatorsrzMsecond element of each tuple in 'libraries' must be a dictionary (build info))	r�list�DistutilsSetupError�tuple�lenrr �sep�dict)rr�libr&�
build_infor	r	r
rvs,

��
��
�zbuild_clib.check_library_listcCs,|js
dSg}|jD]\}}|�|�q|S)N)r�append)rZ	lib_names�lib_namer2r	r	r
�get_library_names�szbuild_clib.get_library_namescCsZ|�|j�g}|jD]>\}}|�d�}|dks>t|ttf�sJtd|��|�|�q|S)N�sources�fin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames)rr�getrr+r-r,�extend)r�	filenamesr4r2r6r	r	r
�get_source_files�s
��zbuild_clib.get_source_filescCs�|D]�\}}|�d�}|dks,t|ttf�s8td|��t|�}t�d|�|�d�}|�d�}|jj||j	|||j
d�}|jj|||j|j
d�qdS)Nr6r7zbuilding '%s' library�macrosr)�
output_dirr<rr)r=r)
r8rr+r-r,r�infor�compilerrZcreate_static_libr)rrr4r2r6r<rZobjectsr	r	r
r%�s,
��

�	
�zbuild_clib.build_libraries)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrZhelp_optionsrr"r(rr5r;r%r	r	r	r
rs(�
��$r)
r Zdistutils.corerZdistutils.errorsZdistutils.sysconfigrZ	distutilsrrrr	r	r	r
�<module>s__pycache__/__init__.cpython-38.opt-2.pyc000064400000000664150513660050014112 0ustar00U

e5d�@s.dddddddddd	d
ddd
dddddgZdS)ZbuildZbuild_pyZ	build_extZ
build_clibZ
build_scriptsZcleanZinstallZinstall_libZinstall_headersZinstall_scriptsZinstall_dataZsdist�registerZbdistZ
bdist_dumbZ	bdist_rpmZ
bdist_wininstZcheckZuploadN)�__all__�rr�2/usr/lib64/python3.8/distutils/command/__init__.py�<module>s&�__pycache__/sdist.cpython-38.opt-2.pyc000064400000025627150513660050013507 0ustar00U

e5d=J�@s�ddlZddlZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	l
mZdd
lmZddlmZddlmZmZd
d�ZGdd�de�ZdS)�N)�glob)�warn)�Command)�dir_util)�	file_util)�archive_util)�TextFile)�FileList)�log)�convert_path)�DistutilsTemplateError�DistutilsOptionErrorcCs`ddlm}ddlm}g}|��D] }|�d|d||df�q$|��||��d�dS)Nr)�FancyGetopt)�ARCHIVE_FORMATS�formats=�z.List of available source distribution formats:)Zdistutils.fancy_getoptrZdistutils.archive_utilr�keys�append�sortZ
print_help)rr�formats�format�r�//usr/lib64/python3.8/distutils/command/sdist.py�show_formatss
��rc@s"eZdZdZdd�Zdddddd	d
ddd
ddddgZddddddgZdddefgZddd�Z	defgZ
dZdd�Zd d!�Z
d"d#�Zd$d%�Zd&d'�Zd(d)�Zed*d+��Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Zd@dA�ZdBdC�ZdDdE�Z dFdG�Z!dHdI�Z"dS)J�sdistz6create a source distribution (tarball, zip file, etc.)cCs|jS�N)�metadata_check��selfrrr�checking_metadata(szsdist.checking_metadata)z	template=�tz5name of manifest template file [default: MANIFEST.in])z	manifest=�mz)name of manifest file [default: MANIFEST])�use-defaultsNzRinclude the default file set in the manifest [default; disable with --no-defaults])�no-defaultsNz"don't include the default file set)�pruneNz�specifically exclude files/directories that should not be distributed (build tree, RCS/CVS dirs, etc.) [default; disable with --no-prune])�no-pruneNz$don't automatically exclude anything)�
manifest-only�ozEjust regenerate the manifest and then stop (implies --force-manifest))�force-manifest�fzkforcibly regenerate the manifest and carry on as usual. Deprecated: now the manifest is always regenerated.)rNz6formats for source distribution (comma-separated list))�	keep-temp�kz@keep the distribution tree around after creating archive file(s))z	dist-dir=�dzFdirectory to put the source distribution archive(s) in [default: dist])�metadata-checkNz[Ensure that all required elements of meta-data are supplied. Warn if any missing. [default])zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]r"r$r&r(r*r-zhelp-formatsNz#list available distribution formats)r#r%�check)ZREADMEz
README.txtz
README.rstcCsTd|_d|_d|_d|_d|_d|_dg|_d|_d|_d|_	d|_
d|_d|_dS)N�rZgztar)
�template�manifest�use_defaultsr$�
manifest_onlyZforce_manifestr�	keep_temp�dist_dir�
archive_filesr�owner�grouprrrr�initialize_optionseszsdist.initialize_optionscCsZ|jdkrd|_|jdkr d|_|�d�t�|j�}|rFtd|��|jdkrVd|_dS)NZMANIFESTzMANIFEST.inrzunknown archive format '%s'Zdist)r3r2Zensure_string_listrZcheck_archive_formatsrr
r7)rZ
bad_formatrrr�finalize_options|s


�
zsdist.finalize_optionscCs>t�|_|��D]}|�|�q|��|jr2dS|��dSr)r	�filelistZget_sub_commandsZrun_command�
get_file_listr5�make_distribution)rZcmd_namerrr�run�sz	sdist.runcCs*tdt�|j�d�}|��|��dS)Nzadistutils.command.sdist.check_metadata is deprecated,               use the check command insteadr0)r�PendingDeprecationWarning�distributionZget_command_objZensure_finalizedr@)rr0rrr�check_metadata�s�zsdist.check_metadatacCs�tj�|j�}|s:|��r:|��|j��|j��dS|sN|�	d|j�|j�
�|jrf|��|rr|�
�|jr�|��|j��|j��|��dS)Nz?manifest template '%s' does not exist (using default file list))�os�path�isfiler2�_manifest_is_not_generated�
read_manifestr=rZremove_duplicatesr�findallr4�add_defaults�
read_templater$�prune_file_list�write_manifest)rZtemplate_existsrrrr>�s(

�


zsdist.get_file_listcCs<|��|��|��|��|��|��|��dSr)�_add_defaults_standards�_add_defaults_optional�_add_defaults_python�_add_defaults_data_files�_add_defaults_ext�_add_defaults_c_libs�_add_defaults_scriptsrrrrrJ�szsdist.add_defaultscCs:tj�|�sdStj�|�}tj�|�\}}|t�|�kS)NF)rDrE�exists�abspath�split�listdir)�fspathrVZ	directory�filenamerrr�_cs_path_exists�s

zsdist._cs_path_existscCs�|j|jjg}|D]~}t|t�rj|}d}|D]"}|�|�r,d}|j�|�qPq,|s�|�dd�	|��q|�|�r�|j�|�q|�d|�qdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found)
�READMESrBZscript_name�
isinstance�tupler[r=rr�join)rZ	standards�fnZaltsZgot_itrrrrN�s"

�
zsdist._add_defaults_standardscCs4ddg}|D]"}ttjjt|��}|j�|�qdS)Nz
test/test*.pyz	setup.cfg)�filterrDrErFrr=�extend)rZoptional�pattern�filesrrrrOszsdist._add_defaults_optionalcCs\|�d�}|j��r$|j�|���|jD],\}}}}|D]}|j�tj	�
||��q:q*dS)N�build_py)�get_finalized_commandrBZhas_pure_modulesr=rb�get_source_files�
data_filesrrDrEr_)rreZpkgZsrc_dirZ	build_dir�	filenamesrZrrrrPs

zsdist._add_defaults_pythoncCsz|j��rv|jjD]b}t|t�rBt|�}tj�|�rt|j	�
|�q|\}}|D]$}t|�}tj�|�rN|j	�
|�qNqdSr)rBZhas_data_filesrhr]�strrrDrErFr=r)r�item�dirnamerir)rrrrQ$s

zsdist._add_defaults_data_filescCs(|j��r$|�d�}|j�|���dS)N�	build_ext)rBZhas_ext_modulesrfr=rbrg)rrmrrrrR5s

zsdist._add_defaults_extcCs(|j��r$|�d�}|j�|���dS)N�
build_clib)rBZhas_c_librariesrfr=rbrg)rrnrrrrS:s

zsdist._add_defaults_c_libscCs(|j��r$|�d�}|j�|���dS)N�
build_scripts)rBZhas_scriptsrfr=rbrg)rrorrrrT?s

zsdist._add_defaults_scriptsc
Cs�t�d|j�t|jddddddd�}zh|��}|dkr:q�z|j�|�Wq(tt	fk
r�}z|�
d|j|j|f�W5d}~XYq(Xq(W5|��XdS)Nzreading manifest template '%s'r1)Zstrip_commentsZskip_blanksZ
join_linesZ	lstrip_wsZ	rstrip_wsZ
collapse_joinz%s, line %d: %s)
r
�infor2r�close�readliner=Zprocess_template_liner�
ValueErrorrrZZcurrent_line)rr2�line�msgrrrrKDs&
�
� zsdist.read_templatecCs�|�d�}|j��}|jjd|jd�|jjd|d�tjdkrFd}nd}dddd	d
ddg}d
|d�|�|f}|jj|dd�dS)N�build)�prefixZwin32z/|\\�/ZRCSZCVSz\.svnz\.hgz\.gitz\.bzrZ_darcsz(^|%s)(%s)(%s).*�|r1)Zis_regex)	rfrB�get_fullnamer=Zexclude_patternZ
build_base�sys�platformr_)rrv�base_dirZsepsZvcs_dirsZvcs_ptrnrrrrLas


�zsdist.prune_file_listcCsX|��rt�d|j�dS|jjdd�}|�dd�|�tj	|j|fd|j�dS)Nz5not writing to manually maintained manifest file '%s'rz*# file GENERATED by distutils, do NOT editzwriting manifest file '%s')
rGr
rpr3r=rd�insertZexecuterZ
write_file)rZcontentrrrrMys��zsdist.write_manifestcCs<tj�|j�sdSt|j�}z|��}W5|��X|dkS)NFz+# file GENERATED by distutils, do NOT edit
)rDrErFr3�openrqrr)r�fpZ
first_linerrrrG�s

z sdist._manifest_is_not_generatedc	CsVt�d|j�t|j��4}|D](}|��}|�d�s|s:q|j�|�qW5QRXdS)Nzreading manifest file '%s'�#)r
rpr3r�strip�
startswithr=r)rr3rtrrrrH�szsdist.read_manifestcCs�|�|�tj|||jd�ttd�r4d}d|}nd}d|}|sPt�d�n
t�|�|D]<}tj	�
|�s|t�d|�q^tj	�||�}|j|||d�q^|j
j�|�dS)	N��dry_run�linkZhardzmaking hard links in %s...zcopying files to %s...z)no files to distribute -- empty manifest?z#'%s' not a regular file -- skipping)r�)ZmkpathrZcreate_treer��hasattrrDr
rrprErFr_Z	copy_filerBZmetadataZwrite_pkg_info)rr}rdr�ru�file�destrrr�make_release_tree�s 
	


zsdist.make_release_treecCs�|j��}tj�|j|�}|�||jj�g}d|j	krT|j	�
|j	�|j	�d���|j	D]:}|j
||||j|jd�}|�
|�|jj�
dd|f�qZ||_|js�tj||jd�dS)NZtar)r}r9r:r�r�)rBrzrDrEr_r7r�r=rdrr�pop�indexZmake_archiver9r:Z
dist_filesr8r6rZremove_treer�)rr}Z	base_namer8Zfmtr�rrrr?�s 




�
zsdist.make_distributioncCs|jSr)r8rrrr�get_archive_files�szsdist.get_archive_files)#�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsZnegative_optZsub_commandsr\r;r<r@rCr>rJ�staticmethodr[rNrOrPrQrRrSrTrKrLrMrGrHr�r?r�rrrrr$sp�'����
(
*r)rDr{r�warningsrZdistutils.corerZ	distutilsrrrZdistutils.text_filerZdistutils.filelistr	r
Zdistutils.utilrZdistutils.errorsrr
rrrrrr�<module>s__pycache__/register.cpython-38.opt-1.pyc000064400000020411150513660050014166 0ustar00U

e5d�-�@sddZddlZddlZddlZddlZddlmZddlm	Z	ddl
TddlmZGdd�de	�Z
dS)	zhdistutils.command.register

Implements the Distutils 'register' command (register with the repository).
�N)�warn)�
PyPIRCCommand)�*)�logc@s�eZdZdZejddgZejdddgZddd	�fgZd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zddd�ZdS) �registerz7register the distribution with the Python package index)�list-classifiersNz list the valid Trove classifiers)�strictNzBWill stop the registering if the meta-data are not fully compliant�verifyrr�checkcCsdS)NT���selfrr�2/usr/lib64/python3.8/distutils/command/register.py�<lambda>�zregister.<lambda>cCst�|�d|_d|_dS)Nr)r�initialize_options�list_classifiersrrrrrrs
zregister.initialize_optionscCs*t�|�d|jfdd�}||jjd<dS)Nr)r�)r�restructuredtextr
)r�finalize_optionsr�distributionZcommand_options)r
Z
check_optionsrrrr$s

�zregister.finalize_optionscCsT|��|��|��D]}|�|�q|jr8|��n|jrH|��n|��dS)N)	r�_set_configZget_sub_commandsZrun_commandZdry_run�verify_metadatar�classifiers�
send_metadata)r
Zcmd_namerrr�run+s

zregister.runcCs8tdt�|j�d�}|��|j|_d|_|��dS)zDeprecated API.zddistutils.command.register.check_metadata is deprecated,               use the check command insteadr
rN)r�PendingDeprecationWarningrZget_command_objZensure_finalizedrrr)r
r
rrr�check_metadata:s�zregister.check_metadatacCsz|��}|ikr@|d|_|d|_|d|_|d|_d|_n6|jd|jfkr^td|j��|jdkrp|j|_d|_d	S)
z: Reads the configuration file and set attributes.
        �username�password�
repository�realmTZpypiz%s not found in .pypircFN)Z_read_pypircrrr r!�
has_configZDEFAULT_REPOSITORY�
ValueError)r
ZconfigrrrrDs




zregister._set_configcCs*|jd}tj�|�}t�|�|��dS)z8 Fetch the list of classifiers from the server.
        z?:action=list_classifiersN)r �urllib�requestZurlopenr�info�_read_pypi_response)r
ZurlZresponserrrrUs
zregister.classifierscCs&|�|�d��\}}t�d||�dS)zF Send the metadata to the package index server to be checked.
        r	�Server response (%s): %sN)�post_to_server�build_post_datarr&)r
�code�resultrrrr\szregister.verify_metadatac
Cs�|jrd}|j}|j}nd}d}}d��}||krd|�dtj�t�}|sRd}q,||kr,td�q,|dk�rl|s|td�}qn|s�t	�	d�}q|t
j��}t
j
�|j�d	}|�|j|||�|�|�d
�|�\}}|�d||ftj�|dk�r�|j�r||j_nf|�d
tj�|�d|��tj�d}|��dk�rNtd�}|�s*d}�q*|��dk�r�|�||��nl|dk�r�ddi}	d|	d<|	d<|	d<d|	d<|	d�s�td�|	d<�q�|	d|	dk�r0|	d�s�t	�	d�|	d<�q�|	d�st	�	d�|	d<�q�|	d|	dk�r�d|	d<d|	d<td��q�|	d�sJtd�|	d<�q0|�|	�\}}|dk�rrt�d||�nt�d�t�d �nP|d!k�r�dd"i}	d|	d<|	d�s�td#�|	d<�q�|�|	�\}}t�d||�dS)$a_ Send the metadata to the package index server.

            Well, do the following:
            1. figure who the user is, and then
            2. send the data as a Basic auth'ed POST.

            First we try to read the username/password from $HOME/.pypirc,
            which is a ConfigParser-formatted file with a section
            [distutils] containing username and password entries (both
            in clear text). Eg:

                [distutils]
                index-servers =
                    pypi

                [pypi]
                username: fred
                password: sekrit

            Otherwise, to figure who the user is, we offer the user three
            choices:

             1. use existing login,
             2. register as a new user, or
             3. set the password to a random string and email the user.

        �1�x�z1 2 3 4z�We need to know who you are, so please choose either:
 1. use your existing login,
 2. register as a new user,
 3. have the server generate a new password for you (and email it to you), or
 4. quit
Your selection [default 1]: z&Please choose one of the four options!z
Username: z
Password: rZsubmitr(��zAI can store your PyPI login so future submissions will be faster.z (the login will be stored in %s)�XZynzSave your login (y/N)?�n�y�2�:action�user�namerZemailNZconfirmz
 Confirm: z!Password and confirm don't match!z
   EMail: z"You will receive an email shortly.z7Follow the instructions in it to complete registration.�3Zpassword_resetzYour email address: )r"rr�split�announcer�INFO�input�print�getpassr$r%ZHTTPPasswordMgr�parseZurlparser Zadd_passwordr!r)r*rZ_get_rc_file�lowerZ
_store_pypircr&)
r
Zchoicerr�choices�authZhostr+r,�datarrrrcs��



��

���








zregister.send_metadatacCs�|jj}|d|��|��|��|��|��|��|��|�	�|�
�|��|��|�
�|��|��|��d�}|ds�|ds�|dr�d|d<|S)Nz1.0)r5�metadata_versionr7�versionZsummaryZ	home_pageZauthorZauthor_email�license�description�keywords�platformrZdownload_url�provides�requires�	obsoletesrJrKrLz1.1rD)rZmetadataZget_nameZget_versionZget_descriptionZget_urlZget_contactZget_contact_emailZget_licenceZget_long_descriptionZget_keywordsZ
get_platformsZget_classifiersZget_download_urlZget_providesZget_requiresZ
get_obsoletes)r
�action�metarCrrrr*�s,�zregister.build_post_dataNc
Cs�d|kr$|�d|d|jftj�d}d|}|d}t��}|��D]~\}}t|�tg�td�fkrn|g}|D]R}t|�}|�	|�|�	d|�|�	d�|�	|�|rr|d	d
krr|�	d�qrqH|�	|�|�	d�|�
��d�}d
|tt|��d�}	t
j�|j||	�}
t
j�t
jj|d��}d}z|�|
�}Wnxt
jjk
�r�}
z"|j�rd|
j��}|
j|
jf}W5d}
~
XYnJt
jjk
�r�}
zdt|
�f}W5d}
~
XYnX|j�r�|�|�}d}|j�r�d�d|df�}|�|tj�|S)zC Post a query to the server, and return a string response.
        r7zRegistering %s to %sz3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254z
--z--rz*
Content-Disposition: form-data; name="%s"z

����
�
zutf-8z/multipart/form-data; boundary=%s; charset=utf-8)zContent-typezContent-length)Zpassword_mgrr/Ni�)r0ZOKzK---------------------------------------------------------------------------)r:r rr;�io�StringIO�items�type�str�write�getvalue�encode�lenr$r%ZRequestZbuild_openerZHTTPBasicAuthHandler�open�errorZ	HTTPErrorZ
show_response�fp�readr+�msgZURLErrorr'�join)r
rCrB�boundaryZsep_boundaryZend_boundaryZbody�key�valueZheadersZreqZopenerr,�er_rrrr)�s^��





��

zregister.post_to_server)N)�__name__�
__module__�__qualname__rGrZuser_optionsZboolean_optionsZsub_commandsrrrrrrrrr*r)rrrrrs*��
zr)�__doc__r>rRZurllib.parser$Zurllib.request�warningsrZdistutils.corerZdistutils.errorsZ	distutilsrrrrrr�<module>s__pycache__/register.cpython-38.pyc000064400000020411150513660050013227 0ustar00U

e5d�-�@sddZddlZddlZddlZddlZddlmZddlm	Z	ddl
TddlmZGdd�de	�Z
dS)	zhdistutils.command.register

Implements the Distutils 'register' command (register with the repository).
�N)�warn)�
PyPIRCCommand)�*)�logc@s�eZdZdZejddgZejdddgZddd	�fgZd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zddd�ZdS) �registerz7register the distribution with the Python package index)�list-classifiersNz list the valid Trove classifiers)�strictNzBWill stop the registering if the meta-data are not fully compliant�verifyrr�checkcCsdS)NT���selfrr�2/usr/lib64/python3.8/distutils/command/register.py�<lambda>�zregister.<lambda>cCst�|�d|_d|_dS)Nr)r�initialize_options�list_classifiersrrrrrrs
zregister.initialize_optionscCs*t�|�d|jfdd�}||jjd<dS)Nr)r�)r�restructuredtextr
)r�finalize_optionsr�distributionZcommand_options)r
Z
check_optionsrrrr$s

�zregister.finalize_optionscCsT|��|��|��D]}|�|�q|jr8|��n|jrH|��n|��dS)N)	r�_set_configZget_sub_commandsZrun_commandZdry_run�verify_metadatar�classifiers�
send_metadata)r
Zcmd_namerrr�run+s

zregister.runcCs8tdt�|j�d�}|��|j|_d|_|��dS)zDeprecated API.zddistutils.command.register.check_metadata is deprecated,               use the check command insteadr
rN)r�PendingDeprecationWarningrZget_command_objZensure_finalizedrrr)r
r
rrr�check_metadata:s�zregister.check_metadatacCsz|��}|ikr@|d|_|d|_|d|_|d|_d|_n6|jd|jfkr^td|j��|jdkrp|j|_d|_d	S)
z: Reads the configuration file and set attributes.
        �username�password�
repository�realmTZpypiz%s not found in .pypircFN)Z_read_pypircrrr r!�
has_configZDEFAULT_REPOSITORY�
ValueError)r
ZconfigrrrrDs




zregister._set_configcCs*|jd}tj�|�}t�|�|��dS)z8 Fetch the list of classifiers from the server.
        z?:action=list_classifiersN)r �urllib�requestZurlopenr�info�_read_pypi_response)r
ZurlZresponserrrrUs
zregister.classifierscCs&|�|�d��\}}t�d||�dS)zF Send the metadata to the package index server to be checked.
        r	�Server response (%s): %sN)�post_to_server�build_post_datarr&)r
�code�resultrrrr\szregister.verify_metadatac
Cs�|jrd}|j}|j}nd}d}}d��}||krd|�dtj�t�}|sRd}q,||kr,td�q,|dk�rl|s|td�}qn|s�t	�	d�}q|t
j��}t
j
�|j�d	}|�|j|||�|�|�d
�|�\}}|�d||ftj�|dk�r�|j�r||j_nf|�d
tj�|�d|��tj�d}|��dk�rNtd�}|�s*d}�q*|��dk�r�|�||��nl|dk�r�ddi}	d|	d<|	d<|	d<d|	d<|	d�s�td�|	d<�q�|	d|	dk�r0|	d�s�t	�	d�|	d<�q�|	d�st	�	d�|	d<�q�|	d|	dk�r�d|	d<d|	d<td��q�|	d�sJtd�|	d<�q0|�|	�\}}|dk�rrt�d||�nt�d�t�d �nP|d!k�r�dd"i}	d|	d<|	d�s�td#�|	d<�q�|�|	�\}}t�d||�dS)$a_ Send the metadata to the package index server.

            Well, do the following:
            1. figure who the user is, and then
            2. send the data as a Basic auth'ed POST.

            First we try to read the username/password from $HOME/.pypirc,
            which is a ConfigParser-formatted file with a section
            [distutils] containing username and password entries (both
            in clear text). Eg:

                [distutils]
                index-servers =
                    pypi

                [pypi]
                username: fred
                password: sekrit

            Otherwise, to figure who the user is, we offer the user three
            choices:

             1. use existing login,
             2. register as a new user, or
             3. set the password to a random string and email the user.

        �1�x�z1 2 3 4z�We need to know who you are, so please choose either:
 1. use your existing login,
 2. register as a new user,
 3. have the server generate a new password for you (and email it to you), or
 4. quit
Your selection [default 1]: z&Please choose one of the four options!z
Username: z
Password: rZsubmitr(��zAI can store your PyPI login so future submissions will be faster.z (the login will be stored in %s)�XZynzSave your login (y/N)?�n�y�2�:action�user�namerZemailNZconfirmz
 Confirm: z!Password and confirm don't match!z
   EMail: z"You will receive an email shortly.z7Follow the instructions in it to complete registration.�3Zpassword_resetzYour email address: )r"rr�split�announcer�INFO�input�print�getpassr$r%ZHTTPPasswordMgr�parseZurlparser Zadd_passwordr!r)r*rZ_get_rc_file�lowerZ
_store_pypircr&)
r
Zchoicerr�choices�authZhostr+r,�datarrrrcs��



��

���








zregister.send_metadatacCs�|jj}|d|��|��|��|��|��|��|��|�	�|�
�|��|��|�
�|��|��|��d�}|ds�|ds�|dr�d|d<|S)Nz1.0)r5�metadata_versionr7�versionZsummaryZ	home_pageZauthorZauthor_email�license�description�keywords�platformrZdownload_url�provides�requires�	obsoletesrJrKrLz1.1rD)rZmetadataZget_nameZget_versionZget_descriptionZget_urlZget_contactZget_contact_emailZget_licenceZget_long_descriptionZget_keywordsZ
get_platformsZget_classifiersZget_download_urlZget_providesZget_requiresZ
get_obsoletes)r
�action�metarCrrrr*�s,�zregister.build_post_dataNc
Cs�d|kr$|�d|d|jftj�d}d|}|d}t��}|��D]~\}}t|�tg�td�fkrn|g}|D]R}t|�}|�	|�|�	d|�|�	d�|�	|�|rr|d	d
krr|�	d�qrqH|�	|�|�	d�|�
��d�}d
|tt|��d�}	t
j�|j||	�}
t
j�t
jj|d��}d}z|�|
�}Wnxt
jjk
�r�}
z"|j�rd|
j��}|
j|
jf}W5d}
~
XYnJt
jjk
�r�}
zdt|
�f}W5d}
~
XYnX|j�r�|�|�}d}|j�r�d�d|df�}|�|tj�|S)zC Post a query to the server, and return a string response.
        r7zRegistering %s to %sz3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254z
--z--rz*
Content-Disposition: form-data; name="%s"z

����
�
zutf-8z/multipart/form-data; boundary=%s; charset=utf-8)zContent-typezContent-length)Zpassword_mgrr/Ni�)r0ZOKzK---------------------------------------------------------------------------)r:r rr;�io�StringIO�items�type�str�write�getvalue�encode�lenr$r%ZRequestZbuild_openerZHTTPBasicAuthHandler�open�errorZ	HTTPErrorZ
show_response�fp�readr+�msgZURLErrorr'�join)r
rCrB�boundaryZsep_boundaryZend_boundaryZbody�key�valueZheadersZreqZopenerr,�er_rrrr)�s^��





��

zregister.post_to_server)N)�__name__�
__module__�__qualname__rGrZuser_optionsZboolean_optionsZsub_commandsrrrrrrrrr*r)rrrrrs*��
zr)�__doc__r>rRZurllib.parser$Zurllib.request�warningsrZdistutils.corerZdistutils.errorsZ	distutilsrrrrrr�<module>s__pycache__/check.cpython-38.pyc000064400000011427150513660050012467 0ustar00U

e5d��@s�dZddlmZddlmZzTddlmZddlmZddl	m
Z
ddl	mZddlm
Z
Gd	d
�d
e�ZdZWnek
r�dZYnXGd
d�de�ZdS)zCdistutils.command.check

Implements the Distutils 'check' command.
�)�Command)�DistutilsSetupError)�Reporter)�Parser)�frontend)�nodes)�StringIOc@seZdZd	dd�Zdd�ZdS)
�SilentReporterNr�ascii�replacec
Cs"g|_t�||||||||�dS�N)�messagesr�__init__)�self�source�report_level�
halt_level�stream�debug�encoding�
error_handler�r�//usr/lib64/python3.8/distutils/command/check.pyrs�zSilentReporter.__init__cOs6|j�||||f�tj|f|�||j|d�|��S)N)�level�type)r
�appendr�system_messageZlevels)rr�messageZchildren�kwargsrrrrs���zSilentReporter.system_message)Nrr
r)�__name__�
__module__�__qualname__rrrrrrr	s�
r	TFc@s`eZdZdZdZdddgZdddgZd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�checkz6This command checks the meta-data of the package.
    z"perform some checks on the package)�metadata�mzVerify meta-data)�restructuredtext�rzEChecks if long string meta-data syntax are reStructuredText-compliant)�strict�sz(Will exit with an error if a check failsr#r%r'cCsd|_d|_d|_d|_dS)z Sets default values for options.r�N)r%r#r'�	_warnings�rrrr�initialize_options1szcheck.initialize_optionscCsdSrrr+rrr�finalize_options8szcheck.finalize_optionscCs|jd7_t�||�S)z*Counts the number of warnings that occurs.r))r*r�warn)r�msgrrrr.;sz
check.warncCsL|jr|��|jr0tr"|��n|jr0td��|jrH|jdkrHtd��dS)zRuns the command.zThe docutils package is needed.rzPlease correct your package.N)r#�check_metadatar%�HAS_DOCUTILS�check_restructuredtextr'rr*r+rrr�run@s
z	check.runcCs�|jj}g}dD]"}t||�r(t||�s|�|�q|rL|�dd�|��|jrd|js�|�d�n"|j	r||j
s�|�d�n
|�d�dS)z�Ensures that all required elements of meta-data are supplied.

        name, version, URL, (author and author_email) or
        (maintainer and maintainer_email)).

        Warns if any are missing.
        )�name�versionZurlzmissing required meta-data: %sz, zLmissing meta-data: if 'author' supplied, 'author_email' must be supplied toozTmissing meta-data: if 'maintainer' supplied, 'maintainer_email' must be supplied toozimissing meta-data: either (author and author_email) or (maintainer and maintainer_email) must be suppliedN)�distributionr#�hasattr�getattrrr.�joinZauthorZauthor_emailZ
maintainerZmaintainer_email)rr#Zmissing�attrrrrr0Pszcheck.check_metadatacCsX|j��}|�|�D]>}|d�d�}|dkr8|d}nd|d|f}|�|�qdS)z4Checks if the long string fields are reST-compliant.����lineNr)z%s (line %s))r6Zget_long_description�_check_rst_data�getr.)r�dataZwarningr<rrrr2ns

zcheck.check_restructuredtextc
Cs�|jjp
d}t�}tjtfd���}d|_d|_d|_t	||j
|j|j|j
|j|jd�}tj|||d�}|�|d�z|�||�Wn:tk
r�}z|j�dd|d	if�W5d}~XYnX|jS)
z8Returns warnings when the provided data doesn't compile.zsetup.py)Z
components�N)rrrr)rr;z!Could not finish the parsing: %s.�)r6Zscript_namerrZOptionParserZget_default_valuesZ	tab_widthZpep_referencesZrfc_referencesr	rrZwarning_streamrZerror_encodingZerror_encoding_error_handlerr�documentZnote_source�parse�AttributeErrorr
r)rr?�source_path�parserZsettingsZreporterrB�errrr=ys.��zcheck._check_rst_dataN)rr r!�__doc__ZdescriptionZuser_optionsZboolean_optionsr,r-r.r3r0r2r=rrrrr"$s�
r"N)rHZdistutils.corerZdistutils.errorsrZdocutils.utilsrZdocutils.parsers.rstrZdocutilsrr�iorr	r1�	Exceptionr"rrrr�<module>s
__pycache__/bdist_rpm.cpython-38.opt-2.pyc000064400000027415150513660050014341 0ustar00U

e5dIT�@s|ddlZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlTddlm
Z
ddlmZGd	d
�d
e�ZdS)�N)�Command)�DEBUG)�get_platform)�
write_file)�*)�get_python_version)�logc)@s�eZdZdZdddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*g)Zd+d,d-d.d/gZd+d,d-d0�Zd1d2�Zd3d4�Zd5d6�Z	d7d8�Z
d9d:�Zd;d<�Zd=d>�Z
d?S)@�	bdist_rpmzcreate an RPM distribution)zbdist-base=Nz/base directory for creating built distributions)z	rpm-base=Nzdbase directory for creating RPMs (defaults to "rpm" under --bdist-base; must be specified for RPM 2))z	dist-dir=�dzDdirectory to put final RPM files in (and .spec files if --spec-only))zpython=NzMpath to Python interpreter to hard-code in the .spec file (default: "python"))z
fix-pythonNzLhard-code the exact path to the current Python interpreter in the .spec file)z	spec-onlyNzonly regenerate spec file)zsource-onlyNzonly generate source RPM)zbinary-onlyNzonly generate binary RPM)z	use-bzip2Nz7use bzip2 instead of gzip to create source distribution)zdistribution-name=Nzgname of the (Linux) distribution to which this RPM applies (*not* the name of the module distribution!))zgroup=Nz9package classification [default: "Development/Libraries"])zrelease=NzRPM release number)zserial=NzRPM serial number)zvendor=NzaRPM "vendor" (eg. "Joe Blow <joe@example.com>") [default: maintainer or author from setup script])z	packager=NzBRPM packager (eg. "Jane Doe <jane@example.net>") [default: vendor])z
doc-files=Nz6list of documentation files (space or comma-separated))z
changelog=Nz
RPM changelog)zicon=Nzname of icon file)z	provides=Nz%capabilities provided by this package)z	requires=Nz%capabilities required by this package)z
conflicts=Nz-capabilities which conflict with this package)zbuild-requires=Nz+capabilities required to build this package)z
obsoletes=Nz*capabilities made obsolete by this package)�
no-autoreqNz+do not automatically calculate dependencies)�	keep-temp�kz"don't clean up RPM build directory)�no-keep-tempNz&clean up RPM build directory [default])�use-rpm-opt-flagsNz8compile with RPM_OPT_FLAGS when building from source RPM)�no-rpm-opt-flagsNz&do not pass any RPM CFLAGS to compiler)�	rpm3-modeNz"RPM 3 compatibility mode (default))�	rpm2-modeNzRPM 2 compatibility mode)zprep-script=Nz3Specify a script for the PREP phase of RPM building)z
build-script=Nz4Specify a script for the BUILD phase of RPM building)zpre-install=Nz:Specify a script for the pre-INSTALL phase of RPM building)zinstall-script=Nz6Specify a script for the INSTALL phase of RPM building)z
post-install=Nz;Specify a script for the post-INSTALL phase of RPM building)zpre-uninstall=Nz<Specify a script for the pre-UNINSTALL phase of RPM building)zpost-uninstall=Nz=Specify a script for the post-UNINSTALL phase of RPM building)z
clean-script=Nz4Specify a script for the CLEAN phase of RPM building)zverify-script=Nz6Specify a script for the VERIFY phase of the RPM build)zforce-arch=Nz0Force an architecture onto the RPM build process)�quiet�qz3Run the INSTALL phase of RPM building in quiet moderrrrr)rrrcCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_!d|_"d|_#d|_$d|_%d|_&dS)Nr�)'�
bdist_base�rpm_base�dist_dir�python�
fix_python�	spec_only�binary_only�source_only�	use_bzip2�distribution_name�group�release�serial�vendor�packager�	doc_files�	changelog�icon�prep_script�build_script�install_script�clean_script�
verify_script�pre_install�post_install�
pre_uninstall�post_uninstall�prep�provides�requires�	conflicts�build_requires�	obsoletes�	keep_temp�use_rpm_opt_flags�	rpm3_mode�
no_autoreq�
force_archr��self�r>�3/usr/lib64/python3.8/distutils/command/bdist_rpm.py�initialize_options�sNzbdist_rpm.initialize_optionscCs�|�dd�|jdkr6|js$td��tj�|jd�|_|jdkrX|j	rPt
j|_qfd|_n|j	rftd��tjdkr~t
dtj��|jr�|jr�td	��|j��s�d
|_|�dd�|��dS)NZbdist)rrz)you must specify --rpm-base in RPM 2 mode�rpmZpython3z8--python and --fix-python are mutually exclusive options�posixz9don't know how to create RPM distributions on platform %sz6cannot supply both '--source-only' and '--binary-only'r)rr)Zset_undefined_optionsrr9ZDistutilsOptionError�os�path�joinrrr�sys�
executable�nameZDistutilsPlatformErrorrr�distribution�has_ext_modulesr8�finalize_package_datar<r>r>r?�finalize_options�s6
�

�
��
zbdist_rpm.finalize_optionscCsT|�dd�|�dd|j��|j��f�|�d�|�d�t|jt�rxdD]&}tj	�
|�rP||jkrP|j�|�qP|�dd	�|�d
�|�d�|�d�|�|j
�|_
|�d
�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�dS)Nr zDevelopment/Librariesr#z%s <%s>r$r%)ZREADMEz
README.txtr!�1r"rr&r'r(r)r*r+r,r-r.r/r0r2r3r4r5r6r;)Z
ensure_stringrIZget_contactZget_contact_emailZensure_string_list�
isinstancer%�listrCrD�exists�append�_format_changelogr&Zensure_filename)r=Zreadmer>r>r?rK�sB
��



















zbdist_rpm.finalize_package_datacCs�tr<td�td|j�td|j�td|j�td|j�|jrT|j}|�|�n8i}dD]&}t	j
�|j|�||<|�||�q\|d}t	j
�|d|j
���}|�t||��fd	|�|jr�dS|j
jdd�}|�d
�}|jr�dg|_ndg|_|�d
�||j
_|��d
}|d}|�||�|j�rbt	j
�|j��rT|�|j|�ntd|j��t�d�dg}	|j�r�|	�d�n|j �r�|	�d�n
|	�d�|	�!dd|j"g�|j#�r�|	�!ddt	j
�$|j�g�|j%�s�|	�d�|j&�r|	�d�|	�|�d}
|
d}d|
d}d|||f}
t	�'|
�}zlg}d}|�)�}|�sV�q�|�*��+�}|�|d�|dk�rD|d
}�qD|�(�}|�r�t,d t-|
���W5|�(�X|�.|	�|j/�s�|j
�0��r�t1�}nd!}|j �s(t	j
�|d"|�}|�2||j�t	j
�|j|�}|j
j�d#||f�|j�s�|D]`}t	j
�|d$|�}t	j
�|��r4|�2||j�t	j
�|jt	j
�3|��}|j
j�d#||f��q4dS)%Nzbefore _get_package_data():zvendor =z
packager =zdoc_files =zchangelog =)�SOURCES�SPECSZBUILD�RPMS�SRPMSrTz%s.speczwriting '%s'�sdistZbztarZgztarrrSzicon file '%s' does not existz
building RPMsZrpmbuildz-bsz-bbz-baz--definez__python %sz
_topdir %sz--cleanz--quietz%{name}-%{version}-%{release}z.src.rpmz%{arch}/z.%{arch}.rpmz%rpm -q --qf '%s %s\n' --specfile '%s'rzFailed to execute: %s�anyrVr	rU)4r�printr#r$r%r&rrZmkpathrCrDrErrI�get_nameZexecuter�_make_spec_fileZ
dist_filesZreinitialize_commandrZformatsZrun_commandZget_archive_filesZ	copy_filer'rPZDistutilsFileErrorr�inforrQr�extendrr9�abspathr7r�popen�close�readline�strip�splitZDistutilsExecError�reprZspawnZdry_runrJrZ	move_file�basename)r=Zspec_dirZrpm_dirr
Z	spec_pathZsaved_dist_filesrW�sourceZ
source_dirZrpm_cmdZ
nvr_stringZsrc_rpmZnon_src_rpmZq_cmd�outZbinary_rpmsZ
source_rpm�line�lZstatusZ	pyversionZsrpm�filenamerAr>r>r?�runs����


�

�


�



�

��z
bdist_rpm.runcCstj�|jtj�|��S)N)rCrDrErre)r=rDr>r>r?�
_dist_path�szbdist_rpm._dist_pathc
CsJd|j��d|j���dd�d|j��d|j�dd�dd|j��g}t�d	�}d
�dd�|�	�D��}d
}d}|�||�}||kr�|�
d�|�
d|d
�|�dddg�|jr�|�
d�n
|�
d�|�d|j�
�d|jddg�|j�s|j���s&|�
d�n|�
d|j�dD]V}t||���}t|t��rb|�
d|d�|�f�n|dk	�r*|�
d||f��q*|j��dk�r�|�
d |j���|j�r�|�
d!|j�|j�r�|�
d"d�|j��|j�r�|�
d#tj�|j��|j�r|�
d$�|�dd%|j��g�d&|jtj�tj d'�f}d(|}	|j!�rXd)|	}	d*|}
d+d,d-|	fd.d/|
fd0d1d2d3d4d5g	}|D]n\}}
}t||
�}|�s�|�r�|�dd6|g�|�r�t"|��}|�|�#��$d
��W5QRXn
|�
|��q�|�dd7d8g�|j%�r$|�
d9d�|j%��|j&�rF|�dd:g�|�|j&�|S);Nz
%define name z%define version �-�_z%define unmangled_version z%define release �z	Summary: zrpm --eval %{__os_install_post}�
cSsg|]}d|���qS)z  %s \)rb)�.0rhr>r>r?�
<listcomp>�s�z-bdist_rpm._make_spec_file.<locals>.<listcomp>zbrp-python-bytecompile \
z%brp-python-bytecompile %{__python} \
z2# Workaround for http://bugs.python.org/issue14443z%define __os_install_post z
Name: %{name}zVersion: %{version}zRelease: %{release}z-Source0: %{name}-%{unmangled_version}.tar.bz2z,Source0: %{name}-%{unmangled_version}.tar.gzz	License: zGroup: z>BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildrootzPrefix: %{_prefix}zBuildArch: noarchz
BuildArch: %s)ZVendorZPackagerZProvidesZRequiresZ	ConflictsZ	Obsoletesz%s: %s� ZUNKNOWNzUrl: zDistribution: zBuildRequires: zIcon: z
AutoReq: 0z%descriptionz%s %srz%s buildzenv CFLAGS="$RPM_OPT_FLAGS" z>%s install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES)r1r(z&%setup -n %{name}-%{unmangled_version}Zbuildr)Zinstallr*)Zcleanr+zrm -rf $RPM_BUILD_ROOT)Zverifyscriptr,N)Zprer-N)Zpostr.N)Zpreunr/N)Zpostunr0N�%z%files -f INSTALLED_FILESz%defattr(-,root,root)z%doc z
%changelog)'rIrZZget_version�replacer!Zget_description�
subprocessZ	getoutputrE�
splitlinesrQr]rZget_licenser r;rJ�getattr�lowerrNrOZget_urlrr5r'rCrDrer:Zget_long_descriptionrrF�argvr8�open�readrcr%r&)r=Z	spec_fileZvendor_hookZproblemZfixedZ
fixed_hookZfield�valZdef_setup_callZ	def_buildZinstall_cmdZscript_optionsZrpm_opt�attr�default�fr>r>r?r[�s��

�
	�
�

�
���
�
 ��zbdist_rpm._make_spec_filecCs||s|Sg}|���d�D]N}|��}|ddkrB|�d|g�q|ddkrZ|�|�q|�d|�q|dsx|d=|S)Nrprrrormz  )rbrcr]rQ)r=r&Z
new_changelogrhr>r>r?rR1szbdist_rpm._format_changelogN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optr@rLrKrkrlr[rRr>r>r>r?r	sx�m��--*r	)rvrFrCZdistutils.corerZdistutils.debugrZdistutils.utilrZdistutils.file_utilrZdistutils.errorsZdistutils.sysconfigrZ	distutilsrr	r>r>r>r?�<module>s__pycache__/install.cpython-38.pyc000064400000032663150513660050013065 0ustar00U

&�.e�j�@sdZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZmZmZdd
lmZddlmZddlmZdd
lmZdZdddddd�Zdddddd�dddddd�ed�Ze�rdddddd�ed <ddd!d"dd�ed#<dZGd$d%�d%e�ZdS)&zFdistutils.command.install

Implements the Distutils 'install' command.�N)�log)�Command)�DEBUG)�get_config_vars)�DistutilsPlatformError)�
write_file)�convert_path�
subst_vars�change_root)�get_platform)�DistutilsOptionError)�	USER_BASE)�	USER_SITETz$base/Lib/site-packagesz$base/Include/$dist_namez
$base/Scriptsz$base)�purelib�platlib�headers�scripts�dataz/$base/lib/python$py_version_short/site-packagesz5$platbase/lib64/python$py_version_short/site-packagesz9$base/include/python$py_version_short$abiflags/$dist_namez	$base/binz$base/lib/pythonz$base/lib64/pythonz$base/include/python/$dist_name)�unix_prefix�	unix_home�ntz	$usersitez4$userbase/Python$py_version_nodot/Include/$dist_namez)$userbase/Python$py_version_nodot/Scriptsz	$userbaseZnt_userz=$userbase/include/python$py_version_short$abiflags/$dist_namez
$userbase/bin�	unix_userc@s:eZdZdZdddddddd	d
ddd
ddddddgZdddgZer`e�dddef�e�d�ddiZ	dd�Z
dd�Zdd �Zd!d"�Z
d#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Zd?d@�ZdAdB�ZdCdD�ZdEefdFefdGefdHefdIdJdK�fgZdS)L�installz'install everything from build directory)zprefix=Nzinstallation prefix)zexec-prefix=Nz.(Unix only) prefix for platform-specific files)zhome=Nz+(Unix only) home directory to install under)z
install-base=Nz;base installation directory (instead of --prefix or --home))zinstall-platbase=Nz\base installation directory for platform-specific files (instead of --exec-prefix or --home))zroot=Nz<install everything relative to this alternate root directory)zinstall-purelib=Nz;installation directory for pure Python module distributions)zinstall-platlib=Nz8installation directory for non-pure module distributions)zinstall-lib=Nzginstallation directory for all module distributions (overrides --install-purelib and --install-platlib))zinstall-headers=Nz(installation directory for C/C++ headers)zinstall-scripts=Nz)installation directory for Python scripts)z
install-data=Nz%installation directory for data files)�compile�czcompile .py to .pyc [default])�
no-compileNzdon't compile .py files)z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�force�fz1force installation (overwrite any existing files))�
skip-buildNz2skip rebuilding everything (for testing/debugging))zrecord=Nz3filename in which to record list of installed filesrrr�userNz!install in user site-package '%s'rcCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_t
|_t|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)zInitializes options.Nr�)�prefix�exec_prefix�homer �install_base�install_platbase�root�install_purelib�install_platlib�install_headers�install_lib�install_scripts�install_datar
�install_userbaser�install_usersiter�optimize�
extra_path�install_path_filer�
skip_build�warn_dir�
build_base�	build_lib�record��self�r:�1/usr/lib64/python3.8/distutils/command/install.py�initialize_options�s2zinstall.initialize_optionscCsx|js|js|jr&|js|jr&td��|jr@|js8|jr@td��|jrl|jsd|jsd|jsd|jsd|jrltd��tjdkr�|jr�|�	d�d|_|�
d�tjdkr�|��n|��|�
d�t
j��d	}td
d�\}}z
t
j}Wntk
r�d}YnX|j��|j��|j��|d
t
jdd�dt
jdd�|||||d�|_t�rf|j|jd<|j|jd<|��|�
d�|j|jd<|j|jd<t�r�d	dlm}td�||j�|� �|�
d�|j�r�|�!�|j"dk�r�|jj#�r�|j$|_"n|j%|_"|�&dddddddd�|�'�|j"|_(tj)�*|j"|j+�|_"|j,dk	�r\|�-ddddddd�|�
d �|�.d!d"d#�dS)$zFinalizes options.zWmust supply either prefix/exec-prefix/home or install-base/install-platbase -- not bothz9must supply either home or prefix/exec-prefix -- not bothzGcan't combine user with prefix, exec_prefix/home, or install_(plat)base�posixz+exec-prefix option ignored on this platformNzpre-finalize_{unix,other}zpost-finalize_{unix,other}()rr"r#�z%d.%d�z%d%d)Z	dist_nameZdist_versionZ
dist_fullname�
py_versionZpy_version_shortZpy_version_nodotZ
sys_prefixr"Zsys_exec_prefixr#�abiflags�userbaseZusersitezpost-expand_basedirs()�baseZplatbase)�pprintzconfig vars:zpost-expand_dirs()�librrrrrZlibbasezafter prepending root�build)r5r5)r6r6)/r"r#r$r%r&rr �os�name�warn�	dump_dirs�
finalize_unix�finalize_other�sys�version�splitrrA�AttributeError�distributionZget_nameZget_versionZget_fullname�version_info�config_vars�
HAS_USER_SITEr.r/�expand_basedirsrrD�print�expand_dirs�create_home_pathr+Zext_modulesr)r(�
convert_paths�handle_extra_path�install_libbase�path�join�
extra_dirsr'�change_rootsZset_undefined_options)r9r@r"r#rArDr:r:r;�finalize_options�s�������








�






�	�
�zinstall.finalize_optionscCs�tsdSddlm}t�|d�|jD]r}|d}|ddkrL|dd�}||jkrx|j|}|�|�}t||�}n|�|�}t||�}t�d||�q(dS)zDumps the list of user options.Nr)�
longopt_xlate�:����=z  %s: %s)	rZdistutils.fancy_getoptrar�debug�user_options�negative_opt�	translate�getattr)r9�msgra�optZopt_name�valr:r:r;rJus





zinstall.dump_dirscCsV|jdk	s|jdk	r\|jdkr2|jdkr2|jdksP|jdksP|jdksP|jdkrXtd��dS|j	r�|j
dkrttd��|j
|_|_|�d�n�|j
dk	r�|j
|_|_|�d�n�|jdk�r$|jdk	r�td��ttd�s�tjtjks�dtjkr�d	}nd
}tj�tj�||_tj�tj�||_n|jdk�r8|j|_|j|_|j|_|�d�dS)z&Finalizes options for posix platforms.NzPinstall-base or install-platbase supplied, but installation scheme is incomplete�$User base directory is not specifiedrrz*must not supply exec-prefix without prefixZreal_prefix�RPM_BUILD_ROOTz/localr>r)r%r&r+r(r)r*r,r-rr r.r�
select_schemer$r"r#�hasattrrM�base_prefixrG�environr\�normpath)r9Zadditionr:r:r;rK�sZ
������
�

�

��zinstall.finalize_unixcCs�|jr8|jdkrtd��|j|_|_|�tjd�n�|jdk	r\|j|_|_|�d�n\|j	dkrvtj
�tj	�|_	|j	|_|_z|�tj�Wn"t
k
r�tdtj��YnXdS)z)Finalizes options for non-posix platformsNrmZ_userrz)I don't know how to install stuff on '%s')r r.rr%r&rorGrHr$r"r\rsrM�KeyErrorr8r:r:r;rL�s&
�

�zinstall.finalize_othercCs<t|}tD]*}d|}t||�dkrt||||�qdS)z=Sets the install directories by applying the install schemes.�install_N)�INSTALL_SCHEMES�SCHEME_KEYSri�setattr)r9rHZscheme�key�attrnamer:r:r;ro�s
zinstall.select_schemecCsX|D]N}t||�}|dk	rtjdks.tjdkr:tj�|�}t||j�}t|||�qdS)Nr=r)rirGrHr\�
expanduserr	rSrx)r9�attrs�attrrlr:r:r;�
_expand_attrs�s
zinstall._expand_attrscCs|�dddg�dS)zNCalls `os.path.expanduser` on install_base, install_platbase and
        root.r%r&r'N�r~r8r:r:r;rU�szinstall.expand_basedirscCs|�ddddddg�dS)z+Calls `os.path.expanduser` on install dirs.r(r)r+r*r,r-Nrr8r:r:r;rW�s�zinstall.expand_dirscGs,|D]"}d|}t||tt||���qdS)z!Call `convert_path` over `names`.ruN)rxrri�r9�namesrHr}r:r:r;rY�szinstall.convert_pathscCs�|jdkr|jj|_|jdk	r�t�d�t|jt�rB|j�d�|_t|j�dkr`|jd}}n"t|j�dkrz|j\}}ntd��t	|�}nd}d}||_
||_dS)	z4Set `path_file` and `extra_dirs` using `extra_path`.NzIDistribution option extra_path is deprecated. See issue27919 for details.�,r!rr?zY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsr>)r1rQrrI�
isinstance�strrO�lenrr�	path_filer^)r9r�r^r:r:r;rZ�s(


��
zinstall.handle_extra_pathc	Gs0|D]&}d|}t||t|jt||���qdS)z:Change the install directories pointed by name using root.ruN)rxr
r'rir�r:r:r;r_szinstall.change_rootscCsb|js
dSttj�d��}|j��D]8\}}|�|�r$tj�|�s$|�	d|�t�
|d�q$dS)zCreate directories under ~.N�~zos.makedirs('%s', 0o700)i�)r rrGr\r{rS�items�
startswith�isdirZdebug_print�makedirs)r9r$rHr\r:r:r;rXszinstall.create_home_pathcCs"|js6|�d�|j�d�j}|jr6|t�kr6td��|��D]}|�|�q>|j	r\|�
�|jr�|��}|j
r�t|j
�}tt|��D]}|||d�||<q�|�t|j|fd|j�ttjjtj�}ttjj|�}tj�tj�|j��}|j�r|j	�r|j�s||k�rt�d|j�dS)zRuns the command.rFz"Can't install when cross-compilingNz'writing list of installed files to '%s'z�modules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)r3Zrun_commandrQZget_command_objZ	plat_namer4rr�get_sub_commandsr��create_path_filer7�get_outputsr'r��range�executer�maprGr\rsrM�normcaser+r2rre)r9Z
build_plat�cmd_name�outputsZroot_lenZcounterZsys_pathr+r:r:r;�run(sD

������zinstall.runcCsJtj�|j|jd�}|jr8|�t||jgfd|�n|�	d|�dS)zCreates the .pth file�.pthzcreating %szpath file '%s' not createdN)
rGr\r]r[r�r2r�rr^rI)r9�filenamer:r:r;r�Ts
�
�zinstall.create_path_filecCshg}|��D].}|�|�}|��D]}||kr"|�|�q"q|jrd|jrd|�tj�|j	|jd��|S)z.Assembles the outputs of all the sub-commands.r�)
r��get_finalized_commandr��appendr�r2rGr\r]r[)r9r�r��cmdr�r:r:r;r�bs
�zinstall.get_outputscCs.g}|��D]}|�|�}|�|���q|S)z*Returns the inputs of all the sub-commands)r�r��extend�
get_inputs)r9Zinputsr�r�r:r:r;r�ss

zinstall.get_inputscCs|j��p|j��S)zSReturns true if the current distribution has any Python
        modules to install.)rQZhas_pure_modulesZhas_ext_modulesr8r:r:r;�has_libs
�zinstall.has_libcCs
|j��S)zLReturns true if the current distribution has any headers to
        install.)rQ�has_headersr8r:r:r;r��szinstall.has_headerscCs
|j��S)zMReturns true if the current distribution has any scripts to.
        install.)rQ�has_scriptsr8r:r:r;r��szinstall.has_scriptscCs
|j��S)zJReturns true if the current distribution has any data to.
        install.)rQZhas_data_filesr8r:r:r;�has_data�szinstall.has_datar+r*r,r-Zinstall_egg_infocCsdS)NTr:r8r:r:r;�<lambda>��zinstall.<lambda>) �__name__�
__module__�__qualname__ZdescriptionrfZboolean_optionsrTr�rrgr<r`rJrKrLror~rUrWrYrZr_rXr�r�r�r�r�r�r�r�Zsub_commandsr:r:r:r;rIsn	�;
�
N3		",
�r)�__doc__rMrGZ	distutilsrZdistutils.corerZdistutils.debugrZdistutils.sysconfigrZdistutils.errorsrZdistutils.file_utilrZdistutils.utilrr	r
rrZsiter
rrTZWINDOWS_SCHEMErvrwrr:r:r:r;�<module>sb�
����
	�
__pycache__/build.cpython-38.opt-1.pyc000064400000007453150513660050013454 0ustar00U

e5d��@sTdZddlZddlZddlmZddlmZddlmZdd�Z	Gdd	�d	e�Z
dS)
zBdistutils.command.build

Implements the Distutils 'build' command.�N)�Command)�DistutilsOptionError)�get_platformcCsddlm}|�dS)Nr��show_compilers)Zdistutils.ccompilerrr�r�//usr/lib64/python3.8/distutils/command/build.pyrsrc@s�eZdZdZdddddddd	d
e�fddd
ddgZddgZdddefgZdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd �Zd!d"�Zd#efd$e
fd%efd&efgZdS)'�buildz"build everything needed to install)zbuild-base=�bz base directory for build library)zbuild-purelib=Nz2build directory for platform-neutral distributions)zbuild-platlib=Nz3build directory for platform-specific distributions)z
build-lib=NzWbuild directory for all distribution (defaults to either build-purelib or build-platlib)zbuild-scripts=Nzbuild directory for scripts)zbuild-temp=�tztemporary build directoryz
plat-name=�pz6platform name to build for, if supported (default: %s))z	compiler=�czspecify the compiler type)z	parallel=�jznumber of parallel build jobs)�debug�gz;compile extensions and libraries with debugging information)�force�fz2forcibly build everything (ignore file timestamps))zexecutable=�ez5specify final destination interpreter path (build.py)rrz
help-compilerNzlist available compilerscCsLd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_dS)Nr	r)�
build_base�
build_purelib�
build_platlib�	build_lib�
build_temp�
build_scriptsZcompiler�	plat_namerr�
executable�parallel��selfrrr�initialize_options8szbuild.initialize_optionscCsb|jdkrt�|_ntjdkr&td��d|jftjdd��}ttd�rR|d7}|jdkrntj	�
|jd�|_|jdkr�tj	�
|jd|�|_|j
dkr�|jjr�|j|_
n|j|_
|jdkr�tj	�
|jd|�|_|jdkr�tj	�
|jd	tjdd��|_|jdk�r tj�r tj	�tj�|_t|jt��r^zt|j�|_Wntk
�r\td
��YnXdS)N�ntzW--plat-name only supported on Windows (try using './configure --help' on your platform)z	.%s-%d.%d�Zgettotalrefcountz-pydebug�libZtempz
scripts-%d.%dzparallel should be an integer)rr�os�namer�sys�version_info�hasattrr�path�joinrrr�distributionZext_modulesrrr�normpath�
isinstancer�str�int�
ValueError)rZplat_specifierrrr�finalize_optionsHsD


�



�



�

�zbuild.finalize_optionscCs|��D]}|�|�qdS�N)Zget_sub_commandsZrun_command)rZcmd_namerrr�run�sz	build.runcCs
|j��Sr1)r*�has_pure_modulesrrrrr3�szbuild.has_pure_modulescCs
|j��Sr1)r*�has_c_librariesrrrrr4�szbuild.has_c_librariescCs
|j��Sr1)r*�has_ext_modulesrrrrr5�szbuild.has_ext_modulescCs
|j��Sr1)r*�has_scriptsrrrrr6�szbuild.has_scriptsZbuild_pyZ
build_clibZ	build_extr)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsrr0r2r3r4r5r6Zsub_commandsrrrrr	sH�����8�r	)�__doc__r%r#Zdistutils.corerZdistutils.errorsrZdistutils.utilrrr	rrrr�<module>s__pycache__/upload.cpython-38.pyc000064400000012100150513660050012663 0ustar00U

&�.e��@s�dZddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
ddlmZddl
mZmZddlmZddlmZdd	lmZGd
d�de�ZdS)zm
distutils.command.upload

Implements the Distutils 'upload' subcommand (upload package to a package
index).
�N)�standard_b64encode)�urlopen�Request�	HTTPError)�urlparse)�DistutilsError�DistutilsOptionError)�
PyPIRCCommand)�spawn)�logc@sJeZdZdZejddgZejdgZdd�Zdd�Zd	d
�Z	dd�Z
d
S)�uploadzupload binary package to PyPI)�sign�szsign files to upload using gpg)z	identity=�izGPG identity used to sign filesr
cCs,t�|�d|_d|_d|_d|_d|_dS)N�rF)r	�initialize_options�username�password�
show_responser
�identity)�self�r�0/usr/lib64/python3.8/distutils/command/upload.pyr s
zupload.initialize_optionscCsrt�|�|jr|jstd��|��}|ikrV|d|_|d|_|d|_|d|_	|jsn|j
jrn|j
j|_dS)Nz.Must use --sign for --identity to have meaningrr�
repository�realm)r	�finalize_optionsrr
rZ_read_pypircrrrr�distribution)rZconfigrrrr(s
�



zupload.finalize_optionscCs:|jjsd}t|��|jjD]\}}}|�|||�qdS)NzHMust create and upload files in one command (e.g. setup.py sdist upload))rZ
dist_filesr�upload_file)r�msg�command�	pyversion�filenamerrr�run:s
z
upload.runc"Cst|j�\}}}}}}	|s"|s"|	r0td|j��|dkrDtd|��|jr|ddd|g}
|jrnd|jg|
dd�<t|
|jd	�t|d
�}z|�	�}W5|��X|j
j}
dd|
��|
�
�tj�|�|f||t�|���d
|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
� �d�}zt�!|���}WnPt"k
�r�}z0d|}|�#|t$j%�ddl&m'}|��s|�W5d}~XYn
X||d<d|d<|j�r�t|dd
��"}tj�|�d|�	�f|d<W5QRX|j(d|j)�*d�}dt+|��,d�}d}d|�*d�}|d}t-�.�}|�/�D]�\}}d|}t0|t1��sP|g}|D]j}t2|�t3k�r�|d|d7}|d}nt4|��*d �}|�5|�|�5|�*d ��|�5d!�|�5|��qT�q.|�5|�|�6�}d"||jf}|�#|t$j%�d#|t4t7|��|d$�}t8|j||d%�}zt9|�}|�:�}|j;} Wnft<k
�rd}z|j=}|j;} W5d}~XYn8t>k
�r�}z|�#t4|�t$j?��W5d}~XYnX|d&k�r�|�#d'|| ft$j%�|j@�r|�A|�}!d(�Bd)|!d)f�}|�#|t$j%�n"d*|| f}|�#|t$j?�tC|��dS)+NzIncompatible url %s)ZhttpZhttpszunsupported schema Zgpgz
--detach-signz-az--local-user�)�dry_run�rbZfile_upload�1z1.0)z:actionZprotocol_version�name�version�contentZfiletyper Z
sha256_digestZmetadata_versionZsummaryZ	home_pageZauthorZauthor_email�license�description�keywords�platformZclassifiersZdownload_urlZprovidesZrequiresZ	obsoletesz#calculating md5 checksum failed: %sr)�
get_fips_modeZ
md5_digestrZcommentz.ascZ
gpg_signature�:�asciizBasic z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s
--s--
z+
Content-Disposition: form-data; name="%s"z; filename="%s"�zutf-8s

zSubmitting %s to %sz multipart/form-data; boundary=%s)zContent-typezContent-lengthZ
Authorization)�data�headers��zServer response (%s): %s�
zK---------------------------------------------------------------------------zUpload failed (%s): %s)Drr�AssertionErrorr
rr
r$�open�close�readrZmetadataZget_nameZget_version�os�path�basename�hashlibZsha256Z	hexdigestZget_descriptionZget_urlZget_contactZget_contact_emailZget_licenceZget_long_descriptionZget_keywordsZ
get_platformsZget_classifiersZget_download_urlZget_providesZget_requiresZ
get_obsoletesZmd5�
ValueErrorZannouncer�INFOZ_hashlibr.rr�encoder�decode�io�BytesIO�items�
isinstance�list�type�tuple�str�write�getvalue�lenrrZgetcoderr�code�OSErrorZERRORrZ_read_pypi_response�joinr)"rrr r!ZschemaZnetlocZurlZparamsZqueryZ	fragmentsZgpg_args�fr)�metar2Zdigest�err.Z	user_passZauth�boundaryZsep_boundaryZend_boundaryZbody�key�value�titler3Zrequest�resultZstatus�reason�textrrrrBs���

�!�




��

�
zupload.upload_fileN)�__name__�
__module__�__qualname__r+r	Zuser_optionsZboolean_optionsrrr"rrrrrrs�r)�__doc__r:rBr-r=�base64rZurllib.requestrrrZurllib.parserZdistutils.errorsrrZdistutils.corer	Zdistutils.spawnr
Z	distutilsrrrrrr�<module>s__pycache__/build_scripts.cpython-38.pyc000064400000010346150513660060014260 0ustar00U

e5dX�@s�dZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZddlZe�d	�ZGd
d�de�ZGdd
�d
ee
�ZdS)zRdistutils.command.build_scripts

Implements the Distutils 'build_scripts' command.�N)�ST_MODE)�	sysconfig)�Command)�newer)�convert_path�	Mixin2to3)�logs^#!.*python[0-9.]*([ 	].*)?$c@sHeZdZdZdddgZdgZdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�
build_scriptsz("build" scripts (copy and fixup #! line))z
build-dir=�dzdirectory to "build" (copy) to)�force�fz1forcibly build everything (ignore file timestamps)zexecutable=�ez*specify final destination interpreter pathrcCs"d|_d|_d|_d|_d|_dS�N)�	build_dir�scriptsr�
executable�outfiles��self�r�7/usr/lib64/python3.8/distutils/command/build_scripts.py�initialize_optionss
z build_scripts.initialize_optionscCs|�dddd�|jj|_dS)NZbuild)r	r)rr)rr)Zset_undefined_optionsZdistributionrrrrr�finalize_options%s�zbuild_scripts.finalize_optionscCs|jSr)rrrrr�get_source_files,szbuild_scripts.get_source_filescCs|js
dS|��dSr)r�copy_scriptsrrrr�run/szbuild_scripts.runc
Cs�|�|j�g}g}|jD�]}d}t|�}tj�|jtj�|��}|�|�|j	slt
||�slt�d|�qzt
|d�}Wn tk
r�|js��d}YnXXt�|j�\}}|�d�|��}	|	s�|�d|�qt�|	�}
|
r�d}|
�d�p�d	}|�rt�d
||j�|�|�|j�stj�s*|j}n(tj�t�d�dt�d
�t�d�f�}t�|�}d||d}
z|
�d�Wn$tk
�r�t d�!|
���YnXz|
�|�Wn&tk
�r�t d�!|
|���YnXt
|d��}|�"|
�|�#|�$��W5QRX|�r8|�%�q|�r"|�%�|�|�|�&||�qtj'dk�r�|D]`}|j�rdt�d|�nDt�(|�t)d@}|dBd@}||k�rJt�d|||�t�*||��qJ||fS)a"Copy each script listed in 'self.scripts'; if it's marked as a
        Python script in the Unix way (first line matches 'first_line_re',
        ie. starts with "\#!" and contains "python"), then adjust the first
        line to refer to the current Python interpreter as we copy.
        Fznot copying %s (up-to-date)�rbNrz%s is an empty file (skipping)T��zcopying and adjusting %s -> %sZBINDIRz
python%s%sZVERSIONZEXEs#!�
zutf-8z.The shebang ({!r}) is not decodable from utf-8zAThe shebang ({!r}) is not decodable from the script encoding ({})�wb�posixzchanging mode of %si�imz!changing mode of %s from %o to %o)+Zmkpathrrr�os�path�join�basename�appendrrr�debug�open�OSError�dry_run�tokenize�detect_encoding�readline�seek�warn�
first_line_re�match�group�inforZpython_buildrZget_config_var�fsencode�decode�UnicodeDecodeError�
ValueError�format�write�
writelines�	readlines�closeZ	copy_file�name�statr�chmod)rr�
updated_filesZscriptZadjustZoutfiler�encoding�linesZ
first_liner1Zpost_interprZshebangZoutf�fileZoldmodeZnewmoderrrr5s�



�

��
��
��




�zbuild_scripts.copy_scriptsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrrrrrrrr	s�r	c@seZdZdd�ZdS)�build_scripts_2to3cCs&t�|�\}}|js|�|�||fSr)r	rr*Zrun_2to3)rrr@rrrr�s
zbuild_scripts_2to3.copy_scriptsN)rDrErFrrrrrrG�srG)�__doc__r"�rer>rZ	distutilsrZdistutils.corerZdistutils.dep_utilrZdistutils.utilrrrr+�compiler0r	rGrrrr�<module>s

__pycache__/install_headers.cpython-38.opt-1.pyc000064400000003256150513660060015514 0ustar00U

e5d�@s$dZddlmZGdd�de�ZdS)z�distutils.command.install_headers

Implements the Distutils 'install_headers' command, to install C/C++ header
files to the Python include directory.�)�Commandc@sFeZdZdZddgZdgZdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�install_headerszinstall C/C++ header files)zinstall-dir=�dz$directory to install header files to)�force�fz-force installation (overwrite existing files)rcCsd|_d|_g|_dS)Nr)�install_dirr�outfiles��self�r�9/usr/lib64/python3.8/distutils/command/install_headers.py�initialize_optionssz"install_headers.initialize_optionscCs|�ddd�dS)NZinstall)rr)rr)Zset_undefined_optionsr	rrr�finalize_optionss�z install_headers.finalize_optionscCsH|jj}|sdS|�|j�|D]"}|�||j�\}}|j�|�q dS�N)�distribution�headersZmkpathrZ	copy_filer�append)r
r�header�out�_rrr�run!szinstall_headers.runcCs|jjp
gSr)rrr	rrr�
get_inputs+szinstall_headers.get_inputscCs|jSr)rr	rrr�get_outputs.szinstall_headers.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsr
rrrrrrrrr
s�
rN)�__doc__Zdistutils.corerrrrrr�<module>s__pycache__/clean.cpython-38.pyc000064400000004066150513660060012476 0ustar00U

e5d�
�@sDdZddlZddlmZddlmZddlmZGdd�de�ZdS)zBdistutils.command.clean

Implements the Distutils 'clean' command.�N)�Command)�remove_tree)�logc@s>eZdZdZddddddgZdgZd	d
�Zdd�Zd
d�ZdS)�cleanz-clean up temporary files from 'build' command)zbuild-base=�bz2base build directory (default: 'build.build-base'))z
build-lib=Nz<build directory for all modules (default: 'build.build-lib'))zbuild-temp=�tz7temporary build directory (default: 'build.build-temp'))zbuild-scripts=Nz<build directory for scripts (default: 'build.build-scripts'))zbdist-base=Nz+temporary directory for built distributions)�all�az7remove all build output, not just temporary by-productsrcCs(d|_d|_d|_d|_d|_d|_dS)N)�
build_base�	build_lib�
build_temp�
build_scripts�
bdist_baser��self�r�//usr/lib64/python3.8/distutils/command/clean.py�initialize_options szclean.initialize_optionscCs"|�ddddd�|�dd�dS)NZbuild)r
r
)rr)r
r
)rrZbdist)rr)Zset_undefined_optionsrrrr�finalize_options(s��zclean.finalize_optionscCs�tj�|j�r t|j|jd�nt�d|j�|jrr|j	|j
|jfD],}tj�|�rdt||jd�qDt�d|�qD|js�zt�
|j�t�d|j�Wntk
r�YnXdS)N)�dry_runz%'%s' does not exist -- can't clean itz
removing '%s')�os�path�existsrrrr�debugrrrr
�warn�rmdirr
�info�OSError)rZ	directoryrrr�run1s*���z	clean.runN)	�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrrrrrrs�	r)	�__doc__rZdistutils.corerZdistutils.dir_utilrZ	distutilsrrrrrr�<module>s
__pycache__/bdist_rpm.cpython-38.opt-1.pyc000064400000030114150513660060014327 0ustar00U

e5dIT�@s�dZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlTddl
mZdd	lmZGd
d�de�ZdS)zwdistutils.command.bdist_rpm

Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions).�N)�Command)�DEBUG)�get_platform)�
write_file)�*)�get_python_version)�logc)@s�eZdZdZdddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*g)Zd+d,d-d.d/gZd+d,d-d0�Zd1d2�Zd3d4�Zd5d6�Z	d7d8�Z
d9d:�Zd;d<�Zd=d>�Z
d?S)@�	bdist_rpmzcreate an RPM distribution)zbdist-base=Nz/base directory for creating built distributions)z	rpm-base=Nzdbase directory for creating RPMs (defaults to "rpm" under --bdist-base; must be specified for RPM 2))z	dist-dir=�dzDdirectory to put final RPM files in (and .spec files if --spec-only))zpython=NzMpath to Python interpreter to hard-code in the .spec file (default: "python"))z
fix-pythonNzLhard-code the exact path to the current Python interpreter in the .spec file)z	spec-onlyNzonly regenerate spec file)zsource-onlyNzonly generate source RPM)zbinary-onlyNzonly generate binary RPM)z	use-bzip2Nz7use bzip2 instead of gzip to create source distribution)zdistribution-name=Nzgname of the (Linux) distribution to which this RPM applies (*not* the name of the module distribution!))zgroup=Nz9package classification [default: "Development/Libraries"])zrelease=NzRPM release number)zserial=NzRPM serial number)zvendor=NzaRPM "vendor" (eg. "Joe Blow <joe@example.com>") [default: maintainer or author from setup script])z	packager=NzBRPM packager (eg. "Jane Doe <jane@example.net>") [default: vendor])z
doc-files=Nz6list of documentation files (space or comma-separated))z
changelog=Nz
RPM changelog)zicon=Nzname of icon file)z	provides=Nz%capabilities provided by this package)z	requires=Nz%capabilities required by this package)z
conflicts=Nz-capabilities which conflict with this package)zbuild-requires=Nz+capabilities required to build this package)z
obsoletes=Nz*capabilities made obsolete by this package)�
no-autoreqNz+do not automatically calculate dependencies)�	keep-temp�kz"don't clean up RPM build directory)�no-keep-tempNz&clean up RPM build directory [default])�use-rpm-opt-flagsNz8compile with RPM_OPT_FLAGS when building from source RPM)�no-rpm-opt-flagsNz&do not pass any RPM CFLAGS to compiler)�	rpm3-modeNz"RPM 3 compatibility mode (default))�	rpm2-modeNzRPM 2 compatibility mode)zprep-script=Nz3Specify a script for the PREP phase of RPM building)z
build-script=Nz4Specify a script for the BUILD phase of RPM building)zpre-install=Nz:Specify a script for the pre-INSTALL phase of RPM building)zinstall-script=Nz6Specify a script for the INSTALL phase of RPM building)z
post-install=Nz;Specify a script for the post-INSTALL phase of RPM building)zpre-uninstall=Nz<Specify a script for the pre-UNINSTALL phase of RPM building)zpost-uninstall=Nz=Specify a script for the post-UNINSTALL phase of RPM building)z
clean-script=Nz4Specify a script for the CLEAN phase of RPM building)zverify-script=Nz6Specify a script for the VERIFY phase of the RPM build)zforce-arch=Nz0Force an architecture onto the RPM build process)�quiet�qz3Run the INSTALL phase of RPM building in quiet moderrrrr)rrrcCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_!d|_"d|_#d|_$d|_%d|_&dS)Nr�)'�
bdist_base�rpm_base�dist_dir�python�
fix_python�	spec_only�binary_only�source_only�	use_bzip2�distribution_name�group�release�serial�vendor�packager�	doc_files�	changelog�icon�prep_script�build_script�install_script�clean_script�
verify_script�pre_install�post_install�
pre_uninstall�post_uninstall�prep�provides�requires�	conflicts�build_requires�	obsoletes�	keep_temp�use_rpm_opt_flags�	rpm3_mode�
no_autoreq�
force_archr��self�r>�3/usr/lib64/python3.8/distutils/command/bdist_rpm.py�initialize_options�sNzbdist_rpm.initialize_optionscCs�|�dd�|jdkr6|js$td��tj�|jd�|_|jdkrX|j	rPt
j|_qfd|_n|j	rftd��tjdkr~t
dtj��|jr�|jr�td	��|j��s�d
|_|�dd�|��dS)NZbdist)rrz)you must specify --rpm-base in RPM 2 mode�rpmZpython3z8--python and --fix-python are mutually exclusive options�posixz9don't know how to create RPM distributions on platform %sz6cannot supply both '--source-only' and '--binary-only'r)rr)Zset_undefined_optionsrr9ZDistutilsOptionError�os�path�joinrrr�sys�
executable�nameZDistutilsPlatformErrorrr�distribution�has_ext_modulesr8�finalize_package_datar<r>r>r?�finalize_options�s6
�

�
��
zbdist_rpm.finalize_optionscCsT|�dd�|�dd|j��|j��f�|�d�|�d�t|jt�rxdD]&}tj	�
|�rP||jkrP|j�|�qP|�dd	�|�d
�|�d�|�d�|�|j
�|_
|�d
�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�dS)Nr zDevelopment/Librariesr#z%s <%s>r$r%)ZREADMEz
README.txtr!�1r"rr&r'r(r)r*r+r,r-r.r/r0r2r3r4r5r6r;)Z
ensure_stringrIZget_contactZget_contact_emailZensure_string_list�
isinstancer%�listrCrD�exists�append�_format_changelogr&Zensure_filename)r=Zreadmer>r>r?rK�sB
��



















zbdist_rpm.finalize_package_datacCs�tr<td�td|j�td|j�td|j�td|j�|jrT|j}|�|�n8i}dD]&}t	j
�|j|�||<|�||�q\|d}t	j
�|d|j
���}|�t||��fd	|�|jr�dS|j
jdd�}|�d
�}|jr�dg|_ndg|_|�d
�||j
_|��d
}|d}|�||�|j�rbt	j
�|j��rT|�|j|�ntd|j��t�d�dg}	|j�r�|	�d�n|j �r�|	�d�n
|	�d�|	�!dd|j"g�|j#�r�|	�!ddt	j
�$|j�g�|j%�s�|	�d�|j&�r|	�d�|	�|�d}
|
d}d|
d}d|||f}
t	�'|
�}zlg}d}|�)�}|�sV�q�|�*��+�}|�|d�|dk�rD|d
}�qD|�(�}|�r�t,d t-|
���W5|�(�X|�.|	�|j/�s�|j
�0��r�t1�}nd!}|j �s(t	j
�|d"|�}|�2||j�t	j
�|j|�}|j
j�d#||f�|j�s�|D]`}t	j
�|d$|�}t	j
�|��r4|�2||j�t	j
�|jt	j
�3|��}|j
j�d#||f��q4dS)%Nzbefore _get_package_data():zvendor =z
packager =zdoc_files =zchangelog =)�SOURCES�SPECSZBUILD�RPMS�SRPMSrTz%s.speczwriting '%s'�sdistZbztarZgztarrrSzicon file '%s' does not existz
building RPMsZrpmbuildz-bsz-bbz-baz--definez__python %sz
_topdir %sz--cleanz--quietz%{name}-%{version}-%{release}z.src.rpmz%{arch}/z.%{arch}.rpmz%rpm -q --qf '%s %s\n' --specfile '%s'rzFailed to execute: %s�anyrVr	rU)4r�printr#r$r%r&rrZmkpathrCrDrErrI�get_nameZexecuter�_make_spec_fileZ
dist_filesZreinitialize_commandrZformatsZrun_commandZget_archive_filesZ	copy_filer'rPZDistutilsFileErrorr�inforrQr�extendrr9�abspathr7r�popen�close�readline�strip�splitZDistutilsExecError�reprZspawnZdry_runrJrZ	move_file�basename)r=Zspec_dirZrpm_dirr
Z	spec_pathZsaved_dist_filesrW�sourceZ
source_dirZrpm_cmdZ
nvr_stringZsrc_rpmZnon_src_rpmZq_cmd�outZbinary_rpmsZ
source_rpm�line�lZstatusZ	pyversionZsrpm�filenamerAr>r>r?�runs����


�

�


�



�

��z
bdist_rpm.runcCstj�|jtj�|��S)N)rCrDrErre)r=rDr>r>r?�
_dist_path�szbdist_rpm._dist_pathc
CsJd|j��d|j���dd�d|j��d|j�dd�dd|j��g}t�d	�}d
�dd�|�	�D��}d
}d}|�||�}||kr�|�
d�|�
d|d
�|�dddg�|jr�|�
d�n
|�
d�|�d|j�
�d|jddg�|j�s|j���s&|�
d�n|�
d|j�dD]V}t||���}t|t��rb|�
d|d�|�f�n|dk	�r*|�
d||f��q*|j��d k�r�|�
d!|j���|j�r�|�
d"|j�|j�r�|�
d#d�|j��|j�r�|�
d$tj�|j��|j�r|�
d%�|�dd&|j��g�d'|jtj�tj d(�f}d)|}	|j!�rXd*|	}	d+|}
d,d-d.|	fd/d0|
fd1d2d3d4d5d6g	}|D]n\}}
}t||
�}|�s�|�r�|�dd7|g�|�r�t"|��}|�|�#��$d
��W5QRXn
|�
|��q�|�dd8d9g�|j%�r$|�
d:d�|j%��|j&�rF|�dd;g�|�|j&�|S)<ziGenerate the text of an RPM spec file and return it as a
        list of strings (one per line).
        z
%define name z%define version �-�_z%define unmangled_version z%define release �z	Summary: zrpm --eval %{__os_install_post}�
cSsg|]}d|���qS)z  %s \)rb)�.0rhr>r>r?�
<listcomp>�s�z-bdist_rpm._make_spec_file.<locals>.<listcomp>zbrp-python-bytecompile \
z%brp-python-bytecompile %{__python} \
z2# Workaround for http://bugs.python.org/issue14443z%define __os_install_post z
Name: %{name}zVersion: %{version}zRelease: %{release}z-Source0: %{name}-%{unmangled_version}.tar.bz2z,Source0: %{name}-%{unmangled_version}.tar.gzz	License: zGroup: z>BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildrootzPrefix: %{_prefix}zBuildArch: noarchz
BuildArch: %s)ZVendorZPackagerZProvidesZRequiresZ	ConflictsZ	Obsoletesz%s: %s� NZUNKNOWNzUrl: zDistribution: zBuildRequires: zIcon: z
AutoReq: 0z%descriptionz%s %srz%s buildzenv CFLAGS="$RPM_OPT_FLAGS" z>%s install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES)r1r(z&%setup -n %{name}-%{unmangled_version}Zbuildr)Zinstallr*)Zcleanr+zrm -rf $RPM_BUILD_ROOT)Zverifyscriptr,N)Zprer-N)Zpostr.N)Zpreunr/N)Zpostunr0N�%z%files -f INSTALLED_FILESz%defattr(-,root,root)z%doc z
%changelog)'rIrZZget_version�replacer!Zget_description�
subprocessZ	getoutputrE�
splitlinesrQr]rZget_licenser r;rJ�getattr�lowerrNrOZget_urlrr5r'rCrDrer:Zget_long_descriptionrrF�argvr8�open�readrcr%r&)r=Z	spec_fileZvendor_hookZproblemZfixedZ
fixed_hookZfield�valZdef_setup_callZ	def_buildZinstall_cmdZscript_optionsZrpm_opt�attr�default�fr>r>r?r[�s��

�
	�
�

�
���
�
 ��zbdist_rpm._make_spec_filecCs||s|Sg}|���d�D]N}|��}|ddkrB|�d|g�q|ddkrZ|�|�q|�d|�q|dsx|d=|S)zKFormat the changelog correctly and convert it to a list of strings
        rprrrormz  )rbrcr]rQ)r=r&Z
new_changelogrhr>r>r?rR1szbdist_rpm._format_changelogN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optr@rLrKrkrlr[rRr>r>r>r?r	sx�m��--*r	)�__doc__rvrFrCZdistutils.corerZdistutils.debugrZdistutils.utilrZdistutils.file_utilrZdistutils.errorsZdistutils.sysconfigrZ	distutilsrr	r>r>r>r?�<module>s__pycache__/build_ext.cpython-38.opt-2.pyc000064400000033546150513660060014340 0ustar00U

e5dP{�@s�ddlZddlZddlZddlZddlmZddlTddlmZm	Z	ddlm
Z
ddlmZddl
mZddlmZdd	lmZdd
lmZe�d�Zdd
�ZGdd�de�ZdS)�N)�Command)�*)�customize_compiler�get_python_version)�get_config_h_filename)�newer_group)�	Extension)�get_platform)�log)�	USER_BASEz3^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$cCsddlm}|�dS)Nr��show_compilers)�distutils.ccompilerr
r�r�3/usr/lib64/python3.8/distutils/command/build_ext.pyr
sr
c@seZdZdZdejZddddde�fdd	d
defdd
ddddefddddddddddgZddddd gZ	d!d"d#e
fgZd$d%�Zd&d'�Z
d(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zejd6d7��Zd8d9�Zd:d;�Zd<d=�Zd>d?�Zd@dA�ZdBdC�ZdDdE�ZdFdG�Zd"S)H�	build_extz8build C/C++ extensions (compile/link to build directory)z (separated by '%s'))z
build-lib=�bz(directory for compiled extension modules)zbuild-temp=�tz1directory for temporary files (build by-products)z
plat-name=�pz>platform name to cross-compile for, if supported (default: %s))�inplace�iziignore build-lib and put compiled extensions into the source directory alongside your pure Python modulesz
include-dirs=�Iz.list of directories to search for header files)zdefine=�DzC preprocessor macros to define)zundef=�Uz!C preprocessor macros to undefine)z
libraries=�lz!external C libraries to link withz
library-dirs=�Lz.directories to search for external C libraries)zrpath=�Rz7directories to search for shared C libraries at runtime)z
link-objects=�Oz2extra explicit link objects to include in the link)�debug�gz'compile/link with debugging information)�force�fz2forcibly build everything (ignore file timestamps))z	compiler=�czspecify the compiler type)z	parallel=�jznumber of parallel build jobs)�swig-cppNz)make SWIG create C++ files (default is C))z
swig-opts=Nz!list of SWIG command line options)zswig=Nzpath to the SWIG executable)�userNz#add user include, library and rpathrrr r$r%z
help-compilerNzlist available compilerscCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_dS)Nr)�
extensions�	build_lib�	plat_name�
build_tempr�package�include_dirs�define�undef�	libraries�library_dirs�rpath�link_objectsrr �compiler�swig�swig_cpp�	swig_optsr%�parallel��selfrrr�initialize_optionsjs*zbuild_ext.initialize_optionsc

Cs�ddlm}|�ddddddd	d
�|jdkr8|jj|_|jj|_|��}|jdd�}|j	dkrn|jj	pjg|_	t
|j	t�r�|j	�t
j�|_	tjtjkr�|j	�t
j�tjd
��|j	�|�t
jj��||kr�|j	�|�t
jj��|�d�|�d�|jdk�rg|_|jdk�rg|_nt
|jt��r:|j�t
j�|_|jdk�rNg|_nt
|jt��rl|j�t
j�|_t
jdk�rh|j�t
j�tjd��tjtjk�r�|j�t
j�tjd��|j�r�t
j�|jd�|_nt
j�|jd�|_|j	�t
j�t���t tdd�}|�r|j�|�|j!dk�r*d}n|j!dd�}t
j�tjd�}|�r\t
j�||�}|j�|�tj"dd�dk�r�tj#�$t
j�tjd���r�|j�t
j�tjddt%�d��n|j�d�|�&d��r�|j'�s�|j�|�&d ��n|j�d�|j(�r|j(�d!�}d"d#�|D�|_(|j)�r4|j)�d!�|_)|j*dk�rHg|_*n|j*�d$�|_*|j+�r�t
j�t,d
�}t
j�t,d�}	t
j�-|��r�|j	�|�t
j�-|	��r�|j�|	�|j�|	�t
|j.t��r�zt/|j.�|_.Wnt0k
�r�t1d%��YnXdS)&Nr)�	sysconfigZbuild)r'r')r)r))r2r2)rr)r r )r6r6)r(r(�)Z
plat_specificZincluder.r1�ntZlibsZDebugZRelease�_home�win32�ZPCbuild��cygwin�bin�lib�pythonZconfig�.�Py_ENABLE_SHAREDZLIBDIR�,cSsg|]}|df�qS)�1r)�.0Zsymbolrrr�
<listcomp>�sz.build_ext.finalize_options.<locals>.<listcomp>� zparallel should be an integer)2�	distutilsr:Zset_undefined_optionsr*�distributionZext_packageZext_modulesr&Zget_python_incr+�
isinstance�str�split�os�pathsep�sys�exec_prefix�base_exec_prefix�append�path�join�extendZensure_string_listr.r/r0�name�prefixrr)�dirnamer�getattrr(�platform�
executable�
startswithr�get_config_varZpython_buildr,r-r5r%r�isdirr6�int�
ValueErrorZDistutilsOptionError)
r8r:Z
py_includeZplat_py_includeZ	_sys_home�suffixZnew_libZdefinesZuser_includeZuser_librrr�finalize_options�s��




�

�zbuild_ext.finalize_optionscCsjddlm}|jsdS|j��rL|�d�}|j�|��p:g�|j	�
|j�||j|j
|j|jd�|_t|j�tjdkr�|jt�kr�|j�|j�|jdk	r�|j�|j�|jdk	r�|jD]\}}|j�||�q�|jdk	r�|jD]}|j�|�q�|jdk	�r|j�|j�|j	dk	�r*|j�|j	�|jdk	�rD|j�|j�|j dk	�r^|j�!|j �|�"�dS)Nr)�new_compiler�
build_clib)r2�verbose�dry_runr r<)#rrgr&rMZhas_c_libraries�get_finalized_commandr.rYZget_library_namesr/rVrhr2rirjr rrQrZr(r	Z
initializer+Zset_include_dirsr,Zdefine_macror-Zundefine_macroZ
set_librariesZset_library_dirsr0Zset_runtime_library_dirsr1Zset_link_objects�build_extensions)r8rgrhrZ�value�macrorrr�runs@

�




z
build_ext.runc
Csvt|t�std��t|�D�]T\}}t|t�r0qt|t�rFt|�dkrNtd��|\}}t�d|�t|t	�rvt
�|�s~td��t|t�s�td��t||d�}dD]"}|�
|�}|dk	r�t|||�q�|�
d	�|_d
|kr�t�d�|�
d�}|�rhg|_g|_|D]b}	t|	t��r"t|	�d
k�s*td��t|	�dk�rJ|j�|	d�nt|	�dk�r|j�|	��q|||<qdS)Nz:'ext_modules' option must be a list of Extension instances�zMeach element of 'ext_modules' option must be an Extension instance or 2-tuplezvold-style (ext_name, build_info) tuple found in ext_modules for extension '%s' -- please convert to Extension instancezRfirst element of each tuple in 'ext_modules' must be the extension name (a string)zOsecond element of each tuple in 'ext_modules' must be a dictionary (build info)�sources)r+r/r.�
extra_objects�extra_compile_args�extra_link_argsr0Zdef_filez9'def_file' element of build info dict no longer supported�macros)r;rpz9'macros' element of build info dict must be 1- or 2-tupler;r)rN�list�DistutilsSetupError�	enumerater�tuple�lenr
�warnrO�extension_name_re�match�dict�get�setattr�runtime_library_dirs�
define_macros�undef_macrosrV)
r8r&r�ext�ext_nameZ
build_info�key�valrurnrrr�check_extensions_listVs^

�
��
��
�


�zbuild_ext.check_extensions_listcCs,|�|j�g}|jD]}|�|j�q|S�N)r�r&rYrq)r8�	filenamesr�rrr�get_source_files�s

zbuild_ext.get_source_filescCs2|�|j�g}|jD]}|�|�|j��q|Sr�)r�r&rV�get_ext_fullpathrZ)r8Zoutputsr�rrr�get_outputs�s

zbuild_ext.get_outputscCs(|�|j�|jr|��n|��dSr�)r�r&r6�_build_extensions_parallel�_build_extensions_serialr7rrrrl�s
zbuild_ext.build_extensionscs��j}�jdkrt��}zddlm}Wntk
r@d}YnX|dkrV���dS||d��P���fdd��jD�}t�j|�D]&\}}��	|��|�
�W5QRXq�W5QRXdS)NTr)�ThreadPoolExecutor)Zmax_workerscsg|]}���j|��qSr)Zsubmit�build_extension)rIr��Zexecutorr8rrrJ�s�z8build_ext._build_extensions_parallel.<locals>.<listcomp>)r6rQ�	cpu_countZconcurrent.futuresr��ImportErrorr�r&�zip�_filter_build_errors�result)r8Zworkersr�Zfuturesr�Zfutrr�rr��s"

�z$build_ext._build_extensions_parallelc
Cs0|jD]$}|�|��|�|�W5QRXqdSr�)r&r�r�)r8r�rrrr��s
z"build_ext._build_extensions_serialc
csTz
dVWnDtttfk
rN}z |js*�|�d|j|f�W5d}~XYnXdS)Nz"building extension "%s" failed: %s)ZCCompilerErrorZDistutilsErrorZCompileErrorZoptionalr{rZ)r8r��errrr��s
�zbuild_ext._filter_build_errorsc
CsP|j}|dkst|ttf�s*td|j��t|�}|�|j�}||j}|jslt	||d�slt
�d|j�dSt
�d|j�|�
||�}|jp�g}|jdd�}|jD]}|�|f�q�|jj||j||j|j||jd�}|dd�|_|jr�|�|j�|j�pg}|j�p|j�|�}	|jj|||�|�|j|j||� |�|j|j|	d�
dS)Nzjin 'ext_modules' option (extension '%s'), 'sources' must be present and must be a list of source filenamesZnewerz$skipping '%s' extension (up-to-date)zbuilding '%s' extension)Z
output_dirrur+r�extra_postargs�depends)r.r/r�r��export_symbolsrr)Ztarget_lang)!rqrNrvryrwrZr�r�r rr
r�info�swig_sourcesrsr�r�rVr2�compiler)r+Z_built_objectsrrrYrt�languageZdetect_languageZlink_shared_object�
get_librariesr/r��get_export_symbols)
r8r�rq�ext_pathr�Z
extra_argsrur-Zobjectsr�rrrr��sX��


�
�zbuild_ext.build_extensioncCs$g}g}i}|jrt�d�|js6d|jks6d|jkr<d}nd}|D]P}tj�|�\}}	|	dkr�|�|d|�|�|�|d||<qD|�|�qD|s�|S|jp�|�	�}
|
dg}|�
|j�|jr�|�d�|js�|jD]}|�|�q�|D].}||}
t�d	||
�|�|d
|
|g�q�|S)Nz/--swig-cpp is deprecated - use --swig-opts=-c++z-c++z.cppz.cz.i�_wrap���z-pythonzswigging %s to %sz-o)
r4r
r{r5rQrW�splitextrVr3�	find_swigrYr�Zspawn)r8rq�	extensionZnew_sourcesr�Zswig_targetsZ
target_ext�source�baser�r3Zswig_cmd�o�targetrrrr�1s@
�


zbuild_ext.swig_sourcescCs^tjdkrdStjdkrLdD]*}tj�d|d�}tj�|�r|SqdStdtj��dS)N�posixr3r<)z1.3z1.2z1.1z	c:\swig%szswig.exez>I don't know how to find (much less run) SWIG on platform '%s')rQrZrWrX�isfileZDistutilsPlatformError)r8Zvers�fnrrrr�gs


��zbuild_ext.find_swigcCs�|�|�}|�d�}|�|d�}|jsRtjj|dd�|g�}tj�|j|�Sd�|dd��}|�d�}tj�	|�
|��}tj�||�S)NrEr�r�build_py)�get_ext_fullnamerP�get_ext_filenamerrQrWrXr'rk�abspathZget_package_dir)r8r��fullname�modpath�filenamer*r�Zpackage_dirrrrr�s


zbuild_ext.get_ext_fullpathcCs |jdkr|S|jd|SdS)NrE)r*)r8r�rrrr��s
zbuild_ext.get_ext_fullnamecCs.ddlm}|�d�}|d�}tjj|�|S)Nr�rarEZ
EXT_SUFFIX)�distutils.sysconfigrarPrQrWrX)r8r�rar�Z
ext_suffixrrrr��s
zbuild_ext.get_ext_filenamecCsxd|j�d�d}z|�d�Wn0tk
rRd|�d��dd��d�}YnXd	|}||jkrr|j�|�|jS)
N�_rEr��asciirZpunycode�-�_ZPyInit)rZrP�encode�UnicodeEncodeError�replace�decoder�rV)r8r�reZ
initfunc_namerrrr��s"
zbuild_ext.get_export_symbolscCs�tjdkr^ddlm}t|j|�s�d}|jr4|d}|tjd?tjd?d@f}|j|gSn�dd	l	m
}d
}|d�r�ttd�r�d
}n<tjdkr�d
}n,dtj
kr�|d�dkr�d
}n|d�dkr�d
}|r�|d�}|jd|gS|jS)Nr>r)�MSVCCompilerz
python%d%dZ_d���r�FrFZgetandroidapilevelTrAZ_PYTHON_HOST_PLATFORMZANDROID_API_LEVELZMACHDEPZ	LDVERSIONrD)rSr^Zdistutils._msvccompilerr�rNr2r�
hexversionr.r�ra�hasattrrQ�environ)r8r�r��templateZ	pythonlibraZlink_libpythonZ	ldversionrrrr��s4

�



zbuild_ext.get_libraries) �__name__�
__module__�__qualname__ZdescriptionrQrRZsep_byr	Zuser_optionsZboolean_optionsr
Zhelp_optionsr9rfror�r�r�rlr�r��
contextlib�contextmanagerr�r�r�r�r�r�r�r�r�rrrrr!sp
�����+��@N	
	K6	
r)r�rQ�rerSZdistutils.corerZdistutils.errorsr�rrrZdistutils.dep_utilrZdistutils.extensionrZdistutils.utilr	rLr
Zsiterr�r|r
rrrrr�<module>s"�__pycache__/build_scripts.cpython-38.opt-1.pyc000064400000010346150513660060015217 0ustar00U

e5dX�@s�dZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZddlZe�d	�ZGd
d�de�ZGdd
�d
ee
�ZdS)zRdistutils.command.build_scripts

Implements the Distutils 'build_scripts' command.�N)�ST_MODE)�	sysconfig)�Command)�newer)�convert_path�	Mixin2to3)�logs^#!.*python[0-9.]*([ 	].*)?$c@sHeZdZdZdddgZdgZdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�
build_scriptsz("build" scripts (copy and fixup #! line))z
build-dir=�dzdirectory to "build" (copy) to)�force�fz1forcibly build everything (ignore file timestamps)zexecutable=�ez*specify final destination interpreter pathrcCs"d|_d|_d|_d|_d|_dS�N)�	build_dir�scriptsr�
executable�outfiles��self�r�7/usr/lib64/python3.8/distutils/command/build_scripts.py�initialize_optionss
z build_scripts.initialize_optionscCs|�dddd�|jj|_dS)NZbuild)r	r)rr)rr)Zset_undefined_optionsZdistributionrrrrr�finalize_options%s�zbuild_scripts.finalize_optionscCs|jSr)rrrrr�get_source_files,szbuild_scripts.get_source_filescCs|js
dS|��dSr)r�copy_scriptsrrrr�run/szbuild_scripts.runc
Cs�|�|j�g}g}|jD�]}d}t|�}tj�|jtj�|��}|�|�|j	slt
||�slt�d|�qzt
|d�}Wn tk
r�|js��d}YnXXt�|j�\}}|�d�|��}	|	s�|�d|�qt�|	�}
|
r�d}|
�d�p�d	}|�rt�d
||j�|�|�|j�stj�s*|j}n(tj�t�d�dt�d
�t�d�f�}t�|�}d||d}
z|
�d�Wn$tk
�r�t d�!|
���YnXz|
�|�Wn&tk
�r�t d�!|
|���YnXt
|d��}|�"|
�|�#|�$��W5QRX|�r8|�%�q|�r"|�%�|�|�|�&||�qtj'dk�r�|D]`}|j�rdt�d|�nDt�(|�t)d@}|dBd@}||k�rJt�d|||�t�*||��qJ||fS)a"Copy each script listed in 'self.scripts'; if it's marked as a
        Python script in the Unix way (first line matches 'first_line_re',
        ie. starts with "\#!" and contains "python"), then adjust the first
        line to refer to the current Python interpreter as we copy.
        Fznot copying %s (up-to-date)�rbNrz%s is an empty file (skipping)T��zcopying and adjusting %s -> %sZBINDIRz
python%s%sZVERSIONZEXEs#!�
zutf-8z.The shebang ({!r}) is not decodable from utf-8zAThe shebang ({!r}) is not decodable from the script encoding ({})�wb�posixzchanging mode of %si�imz!changing mode of %s from %o to %o)+Zmkpathrrr�os�path�join�basename�appendrrr�debug�open�OSError�dry_run�tokenize�detect_encoding�readline�seek�warn�
first_line_re�match�group�inforZpython_buildrZget_config_var�fsencode�decode�UnicodeDecodeError�
ValueError�format�write�
writelines�	readlines�closeZ	copy_file�name�statr�chmod)rr�
updated_filesZscriptZadjustZoutfiler�encoding�linesZ
first_liner1Zpost_interprZshebangZoutf�fileZoldmodeZnewmoderrrr5s�



�

��
��
��




�zbuild_scripts.copy_scriptsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrrrrrrrr	s�r	c@seZdZdd�ZdS)�build_scripts_2to3cCs&t�|�\}}|js|�|�||fSr)r	rr*Zrun_2to3)rrr@rrrr�s
zbuild_scripts_2to3.copy_scriptsN)rDrErFrrrrrrG�srG)�__doc__r"�rer>rZ	distutilsrZdistutils.corerZdistutils.dep_utilrZdistutils.utilrrrr+�compiler0r	rGrrrr�<module>s

__pycache__/config.cpython-38.pyc000064400000023765150513660060012670 0ustar00U

e5d=3�@sldZddlZddlZddlmZddlmZddlmZddl	m
Z
ddd	�ZGd
d�de�Zddd
�Z
dS)a�distutils.command.config

Implements the Distutils 'config' command, a (mostly) empty command class
that exists mainly to be sub-classed by specific module distributions and
applications.  The idea is that while every "config" command is different,
at least they're all named the same, and users always see "config" in the
list of standard commands.  Also, this is a good place to put common
configure-like tasks: "try to compile this C code", or "figure out where
this header file lives".
�N)�Command)�DistutilsExecError)�customize_compiler)�logz.cz.cxx)�czc++c	@s�eZdZdZdddddddd	d
g	Zdd�Zd
d�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
d0dd �Zd1d!d"�Zd2d#d$�Zd3d%d&�Zd4d'd(�Zd5d*d+�Zdddgfd,d-�Zd6d.d/�ZdS)7�configzprepare to build)z	compiler=Nzspecify the compiler type)zcc=Nzspecify the compiler executable)z
include-dirs=�Iz.list of directories to search for header files)zdefine=�DzC preprocessor macros to define)zundef=�Uz!C preprocessor macros to undefine)z
libraries=�lz!external C libraries to link with)z
library-dirs=�Lz.directories to search for external C libraries)�noisyNz1show every action (compile, link, run, ...) taken)zdump-sourceNz=dump generated source files before attempting to compile themcCs4d|_d|_d|_d|_d|_d|_d|_g|_dS)N�)�compilerZcc�include_dirs�	libraries�library_dirsr
�dump_source�
temp_files��self�r�0/usr/lib64/python3.8/distutils/command/config.py�initialize_options3szconfig.initialize_optionscCs�|jdkr|jjpg|_nt|jt�r6|j�tj�|_|jdkrHg|_nt|jt�r^|jg|_|jdkrpg|_nt|jt�r�|j�tj�|_dS�N)	rZdistribution�
isinstance�str�split�os�pathseprrrrrr�finalize_optionsBs



zconfig.finalize_optionscCsdSrrrrrr�runRsz
config.runcCszddlm}m}t|j|�sv||j|jdd�|_t|j�|jrN|j�|j�|j	rb|j�
|j	�|jrv|j�|j�dS)z^Check that 'self.compiler' really is a CCompiler object;
        if not, make it one.
        r)�	CCompiler�new_compilerr)r�dry_runZforceN)
�distutils.ccompilerr"r#rrr$rrZset_include_dirsrZ
set_librariesrZset_library_dirs)rr"r#rrr�_check_compilerYs�
zconfig._check_compilerc	Csldt|}t|d��L}|r>|D]}|�d|�q |�d�|�|�|ddkr^|�d�W5QRX|S)NZ_configtest�wz#include <%s>
�
���)�LANG_EXT�open�write)r�body�headers�lang�filename�file�headerrrr�_gen_temp_sourcefileks

zconfig._gen_temp_sourcefilecCs<|�|||�}d}|j�||g�|jj|||d�||fS)Nz
_configtest.i�r)r3r�extendrZ
preprocess)rr-r.rr/�src�outrrr�_preprocessws
zconfig._preprocesscCs\|�|||�}|jr"t|d|�|j�|g�\}|j�||g�|jj|g|d�||fS)Nzcompiling '%s':r4)r3r�	dump_filerZobject_filenamesrr5�compile)rr-r.rr/r6�objrrr�_compile~szconfig._compilec
Csr|�||||�\}}tj�tj�|��d}	|jj|g|	|||d�|jjdk	r\|	|jj}	|j�	|	�|||	fS)Nr)rrZtarget_lang)
r<r�path�splitext�basenamerZlink_executableZ
exe_extensionr�append)
rr-r.rrrr/r6r;�progrrr�_link�s�zconfig._linkc	GsT|s|j}g|_t�dd�|��|D](}zt�|�Wq&tk
rLYq&Xq&dS)Nzremoving: %s� )rr�info�joinr�remove�OSError)r�	filenamesr0rrr�_clean�sz
config._cleanNrcCsRddlm}|��d}z|�||||�Wn|k
rDd}YnX|��|S)aQConstruct a source file from 'body' (a string containing lines
        of C/C++ code) and 'headers' (a list of header files to include)
        and run it through the preprocessor.  Return true if the
        preprocessor succeeded, false if there were any errors.
        ('body' probably isn't of much use, but what the heck.)
        r��CompileErrorTF)r%rKr&r8rI�rr-r.rr/rK�okrrr�try_cpp�s
zconfig.try_cppc	Csx|��|�||||�\}}t|t�r0t�|�}t|��.}d}	|��}
|
dkrPqb|�|
�r>d}	qbq>W5QRX|�	�|	S)a�Construct a source file (just like 'try_cpp()'), run it through
        the preprocessor, and return true if any line of the output matches
        'pattern'.  'pattern' should either be a compiled regex object or a
        string containing a regex.  If both 'body' and 'headers' are None,
        preprocesses an empty file -- which can be useful to determine the
        symbols the preprocessor and compiler set by default.
        F�T)
r&r8rr�rer:r+�readline�searchrI)r�patternr-r.rr/r6r7r1�match�linerrr�
search_cpp�s	



zconfig.search_cppcCsdddlm}|��z|�||||�d}Wn|k
rDd}YnXt�|rRdpTd�|��|S)zwTry to compile a source file built from 'body' and 'headers'.
        Return true on success, false otherwise.
        rrJTF�success!�failure.)r%rKr&r<rrDrIrLrrr�try_compile�s
zconfig.try_compilec
	Cspddlm}m}|��z|�||||||�d}	Wn||fk
rPd}	YnXt�|	r^dp`d�|��|	S)z�Try to compile and link a source file, built from 'body' and
        'headers', to executable form.  Return true on success, false
        otherwise.
        r�rK�	LinkErrorTFrWrX)r%rKr[r&rBrrDrI)
rr-r.rrrr/rKr[rMrrr�try_link�s
�
zconfig.try_linkc

Cs�ddlm}m}|��z.|�||||||�\}	}
}|�|g�d}Wn||tfk
rdd}YnXt�|rrdptd�|�	�|S)z�Try to compile, link to an executable, and run a program
        built from 'body' and 'headers'.  Return true on success, false
        otherwise.
        rrZTFrWrX)
r%rKr[r&rBZspawnrrrDrI)
rr-r.rrrr/rKr[r6r;ZexerMrrr�try_run�s
�

zconfig.try_runrc	Cst|��g}|r|�d|�|�d�|r<|�d|�n|�d|�|�d�d�|�d}|�|||||�S)a�Determine if function 'func' is available by constructing a
        source file that refers to 'func', and compiles and links it.
        If everything succeeds, returns true; otherwise returns false.

        The constructed source file starts out by including the header
        files listed in 'headers'.  If 'decl' is true, it then declares
        'func' (as "int func()"); you probably shouldn't supply 'headers'
        and set 'decl' true in the same call, or you might get errors about
        a conflicting declarations for 'func'.  Finally, the constructed
        'main()' function either references 'func' or (if 'call' is true)
        calls it.  'libraries' and 'library_dirs' are used when
        linking.
        z
int %s ();z
int main () {z  %s();z  %s;�}r()r&r@rEr\)	r�funcr.rrrZdeclZcallr-rrr�
check_funcs


�zconfig.check_funccCs |��|�d|||g||�S)a�Determine if 'library' is available to be linked against,
        without actually checking that any particular symbols are provided
        by it.  'headers' will be used in constructing the source file to
        be compiled, but the only effect of this is to check if all the
        header files listed are available.  Any libraries listed in
        'other_libraries' will be included in the link, in case 'library'
        has symbols that depend on other libraries.
        zint main (void) { })r&r\)rZlibraryrr.rZother_librariesrrr�	check_lib4s


�zconfig.check_libcCs|jd|g|d�S)z�Determine if the system header file named by 'header_file'
        exists and can be found by the preprocessor; return true if so,
        false otherwise.
        z
/* No body */)r-r.r)rN)rr2rrr/rrr�check_headerBs
�zconfig.check_header)NNNr)NNNr)NNr)NNNNr)NNNNr)NNNNrr)NNr)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsrr r!r&r3r8r<rBrIrNrVrYr\r]r`rarbrrrrrs\�	
�

�
�
�
�
�rcCsJ|dkrt�d|�n
t�|�t|�}zt�|���W5|��XdS)zjDumps a file content into log.info.

    If head is not None, will be dumped before the file content.
    Nz%s)rrDr+�close�read)r0�headr1rrrr9Ks
r9)N)�__doc__rrPZdistutils.corerZdistutils.errorsrZdistutils.sysconfigrZ	distutilsrr*rr9rrrr�<module>s
8__pycache__/install_data.cpython-38.opt-2.pyc000064400000004142150513660060015006 0ustar00U

e5d�@s8ddlZddlmZddlmZmZGdd�de�ZdS)�N)�Command)�change_root�convert_pathc@sHeZdZdZdddgZdgZdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�install_datazinstall data files)zinstall-dir=�dzIbase directory for installing data files (default: installation base dir))zroot=Nz<install everything relative to this alternate root directory)�force�fz-force installation (overwrite existing files)rcCs,d|_g|_d|_d|_|jj|_d|_dS)Nr�)�install_dir�outfiles�rootrZdistribution�
data_files�warn_dir��self�r�6/usr/lib64/python3.8/distutils/command/install_data.py�initialize_optionss
zinstall_data.initialize_optionscCs|�dddd�dS)NZinstall)rr
)rr)rr)Zset_undefined_optionsrrrr�finalize_options#s
�zinstall_data.finalize_optionscCs�|�|j�|jD]�}t|t�rbt|�}|jrB|�d||jf�|�||j�\}}|j	�
|�qt|d�}tj�
|�s�tj�|j|�}n|jr�t|j|�}|�|�|dgkr�|j	�
|�q|dD](}t|�}|�||�\}}|j	�
|�q�qdS)NzMsetup script did not provide a directory for '%s' -- installing right in '%s'rr	)Zmkpathr
r
�
isinstance�strrr�warnZ	copy_filer�append�os�path�isabs�joinrr)rr�out�_�dir�datarrr�run*s,

�
zinstall_data.runcCs
|jpgS�N)r
rrrr�
get_inputsKszinstall_data.get_inputscCs|jSr")rrrrr�get_outputsNszinstall_data.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrr!r#r$rrrrrs�	!r)rZdistutils.corerZdistutils.utilrrrrrrr�<module>s__pycache__/bdist.cpython-38.pyc000064400000007124150513660060012517 0ustar00U

e5d��@sHdZddlZddlmZddlTddlmZdd�ZGdd	�d	e�ZdS)
zidistutils.command.bdist

Implements the Distutils 'bdist' command (create a built [binary]
distribution).�N)�Command)�*)�get_platformcCsPddlm}g}tjD]"}|�d|dtj|df�q||�}|�d�dS)zFPrint list of available formats (arguments to "--format" option).
    r)�FancyGetopt�formats=N�z'List of available distribution formats:)Zdistutils.fancy_getoptr�bdist�format_commands�append�format_commandZ
print_help)r�formats�formatZpretty_printer�r�//usr/lib64/python3.8/distutils/command/bdist.py�show_formatss
�rc
@s�eZdZdZdddde�fdddd	d
gZdgZdd
defgZdZ	ddd�Z
dddddddddg	Zddddddd d!d"d#�	Zd$d%�Z
d&d'�Zd(d)�Zd
S)*rz$create a built (binary) distribution)zbdist-base=�bz4temporary directory for creating built distributionsz
plat-name=�pz;platform name to embed in generated filenames (default: %s))rNz/formats for distribution (comma-separated list))z	dist-dir=�dz=directory to put final built distributions in [default: dist])�
skip-buildNz2skip rebuilding everything (for testing/debugging))zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]rzhelp-formatsNz$lists available distribution formats)�	bdist_rpm�gztar�zip)�posix�nt�rpm�bztar�xztar�ztar�tar�wininst�msi)rzRPM distribution)�
bdist_dumbzgzip'ed tar file)r#zbzip2'ed tar file)r#zxz'ed tar file)r#zcompressed tar file)r#ztar file)Z
bdist_wininstzWindows executable installer)r#zZIP file)Z	bdist_msizMicrosoft Installer)	rrrrrr r!rr"cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr)�
bdist_base�	plat_namer�dist_dir�
skip_build�group�owner)�selfrrr�initialize_optionsQszbdist.initialize_optionscCs�|jdkr(|jrt�|_n|�d�j|_|jdkrT|�d�j}tj�|d|j�|_|�	d�|j
dkr�z|jtjg|_
Wn"t
k
r�tdtj��YnX|jdkr�d|_dS)NZbuildzbdist.rz;don't know how to create built distributions on platform %sZdist)r%r'rZget_finalized_commandr$�
build_base�os�path�joinZensure_string_listr�default_format�name�KeyErrorZDistutilsPlatformErrorr&)r*r,rrr�finalize_optionsZs*


�

��

zbdist.finalize_optionsc	Cs�g}|jD]>}z|�|j|d�Wq
tk
rFtd|��Yq
Xq
tt|j��D]h}||}|�|�}||jkr�|j||_	|dkr�|j
|_
|j|_|||dd�kr�d|_|�
|�qXdS)Nrzinvalid format '%s'r#r)rr
rr2ZDistutilsOptionError�range�lenZreinitialize_command�no_format_optionr
r)r(Z	keep_tempZrun_command)r*Zcommandsr
�iZcmd_nameZsub_cmdrrr�runvs"


z	bdist.run)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsr6r0r	rr+r3r8rrrrrsR��������
	r)	�__doc__r-Zdistutils.corerZdistutils.errorsZdistutils.utilrrrrrrr�<module>s__pycache__/build_clib.cpython-38.pyc000064400000011320150513660060013473 0ustar00U

e5dV�@sTdZddlZddlmZddlTddlmZddlmZdd�Z	Gd	d
�d
e�Z
dS)z�distutils.command.build_clib

Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module.�N)�Command)�*)�customize_compiler)�logcCsddlm}|�dS)Nr��show_compilers)�distutils.ccompilerrr�r	�4/usr/lib64/python3.8/distutils/command/build_clib.pyrsrc@sleZdZdZdddddgZddgZd	d
defgZdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zd
S)�
build_clibz/build C/C++ libraries used by Python extensions)zbuild-clib=�bz%directory to build C/C++ libraries to)zbuild-temp=�tz,directory to put temporary build by-products)�debug�gz"compile with debugging information)�force�fz2forcibly build everything (ignore file timestamps))z	compiler=�czspecify the compiler typerrz
help-compilerNzlist available compilerscCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	r�
build_temp�	libraries�include_dirs�define�undefrr�compiler��selfr	r	r
�initialize_options4szbuild_clib.initialize_optionscCsh|�dddddd�|jj|_|jr0|�|j�|jdkrH|jjpDg|_t|jt�rd|j�tj	�|_dS)NZbuild)rr)rr)rr)rr)rr)
Zset_undefined_optionsZdistributionr�check_library_listr�
isinstance�str�split�os�pathseprr	r	r
�finalize_optionsDs�

zbuild_clib.finalize_optionscCs�|js
dSddlm}||j|j|jd�|_t|j�|jdk	rN|j�|j�|j	dk	rv|j	D]\}}|j�
||�q^|jdk	r�|jD]}|j�|�q�|�
|j�dS)Nr)�new_compiler)r�dry_runr)rrr#rr$rrrZset_include_dirsrZdefine_macrorZundefine_macro�build_libraries)rr#�name�valueZmacror	r	r
�run^s"�




zbuild_clib.runcCs�t|t�std��|D]z}t|t�s8t|�dkr8td��|\}}t|t�sRtd��d|ksntjdkr~tj|kr~td|d��t|t�std��qd	S)
a`Ensure that the list of libraries is valid.

        `library` is presumably provided as a command option 'libraries'.
        This method checks that it is a list of 2-tuples, where the tuples
        are (library_name, build_info_dict).

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z+'libraries' option must be a list of tuples�z*each element of 'libraries' must a 2-tuplezNfirst element of each tuple in 'libraries' must be a string (the library name)�/z;bad library name '%s': may not contain directory separatorsrzMsecond element of each tuple in 'libraries' must be a dictionary (build info)N)	r�list�DistutilsSetupError�tuple�lenrr �sep�dict)rr�libr&�
build_infor	r	r
rvs,

��
��
�zbuild_clib.check_library_listcCs,|js
dSg}|jD]\}}|�|�q|S)N)r�append)rZ	lib_names�lib_namer2r	r	r
�get_library_names�szbuild_clib.get_library_namescCsZ|�|j�g}|jD]>\}}|�d�}|dks>t|ttf�sJtd|��|�|�q|S)N�sources�fin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames)rr�getrr+r-r,�extend)r�	filenamesr4r2r6r	r	r
�get_source_files�s
��zbuild_clib.get_source_filescCs�|D]�\}}|�d�}|dks,t|ttf�s8td|��t|�}t�d|�|�d�}|�d�}|jj||j	|||j
d�}|jj|||j|j
d�qdS)Nr6r7zbuilding '%s' library�macrosr)�
output_dirr<rr)r=r)
r8rr+r-r,r�infor�compilerrZcreate_static_libr)rrr4r2r6r<rZobjectsr	r	r
r%�s,
��

�	
�zbuild_clib.build_libraries)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrZhelp_optionsrr"r(rr5r;r%r	r	r	r
rs(�
��$r)�__doc__r Zdistutils.corerZdistutils.errorsZdistutils.sysconfigrZ	distutilsrrrr	r	r	r
�<module>s__pycache__/bdist.cpython-38.opt-2.pyc000064400000006622150513660060013461 0ustar00U

e5d��@sDddlZddlmZddlTddlmZdd�ZGdd�de�ZdS)	�N)�Command)�*)�get_platformcCsPddlm}g}tjD]"}|�d|dtj|df�q||�}|�d�dS)Nr)�FancyGetopt�formats=�z'List of available distribution formats:)Zdistutils.fancy_getoptr�bdist�format_commands�append�format_commandZ
print_help)r�formats�formatZpretty_printer�r�//usr/lib64/python3.8/distutils/command/bdist.py�show_formatss
�rc
@s�eZdZdZdddde�fdddd	d
gZdgZdd
defgZdZ	ddd�Z
dddddddddg	Zddddddd d!d"d#�	Zd$d%�Z
d&d'�Zd(d)�Zd
S)*rz$create a built (binary) distribution)zbdist-base=�bz4temporary directory for creating built distributionsz
plat-name=�pz;platform name to embed in generated filenames (default: %s))rNz/formats for distribution (comma-separated list))z	dist-dir=�dz=directory to put final built distributions in [default: dist])�
skip-buildNz2skip rebuilding everything (for testing/debugging))zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]rzhelp-formatsNz$lists available distribution formats)�	bdist_rpm�gztar�zip)�posix�nt�rpm�bztar�xztar�ztar�tar�wininst�msi)rzRPM distribution)�
bdist_dumbzgzip'ed tar file)r#zbzip2'ed tar file)r#zxz'ed tar file)r#zcompressed tar file)r#ztar file)Z
bdist_wininstzWindows executable installer)r#zZIP file)Z	bdist_msizMicrosoft Installer)	rrrrrr r!rr"cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr)�
bdist_base�	plat_namer�dist_dir�
skip_build�group�owner)�selfrrr�initialize_optionsQszbdist.initialize_optionscCs�|jdkr(|jrt�|_n|�d�j|_|jdkrT|�d�j}tj�|d|j�|_|�	d�|j
dkr�z|jtjg|_
Wn"t
k
r�tdtj��YnX|jdkr�d|_dS)NZbuildzbdist.rz;don't know how to create built distributions on platform %sZdist)r%r'rZget_finalized_commandr$�
build_base�os�path�joinZensure_string_listr�default_format�name�KeyErrorZDistutilsPlatformErrorr&)r*r,rrr�finalize_optionsZs*


�

��

zbdist.finalize_optionsc	Cs�g}|jD]>}z|�|j|d�Wq
tk
rFtd|��Yq
Xq
tt|j��D]h}||}|�|�}||jkr�|j||_	|dkr�|j
|_
|j|_|||dd�kr�d|_|�
|�qXdS)Nrzinvalid format '%s'r#r)rr
rr2ZDistutilsOptionError�range�lenZreinitialize_command�no_format_optionr
r)r(Z	keep_tempZrun_command)r*Zcommandsr
�iZcmd_nameZsub_cmdrrr�runvs"


z	bdist.run)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsr6r0r	rr+r3r8rrrrrsR��������
	r)r-Zdistutils.corerZdistutils.errorsZdistutils.utilrrrrrrr�<module>s
__pycache__/bdist_rpm.cpython-38.pyc000064400000030216150513660060013373 0ustar00U

e5dIT�@s�dZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlTddl
mZdd	lmZGd
d�de�ZdS)zwdistutils.command.bdist_rpm

Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions).�N)�Command)�DEBUG)�get_platform)�
write_file)�*)�get_python_version)�logc)@s�eZdZdZdddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*g)Zd+d,d-d.d/gZd+d,d-d0�Zd1d2�Zd3d4�Zd5d6�Z	d7d8�Z
d9d:�Zd;d<�Zd=d>�Z
d?S)@�	bdist_rpmzcreate an RPM distribution)zbdist-base=Nz/base directory for creating built distributions)z	rpm-base=Nzdbase directory for creating RPMs (defaults to "rpm" under --bdist-base; must be specified for RPM 2))z	dist-dir=�dzDdirectory to put final RPM files in (and .spec files if --spec-only))zpython=NzMpath to Python interpreter to hard-code in the .spec file (default: "python"))z
fix-pythonNzLhard-code the exact path to the current Python interpreter in the .spec file)z	spec-onlyNzonly regenerate spec file)zsource-onlyNzonly generate source RPM)zbinary-onlyNzonly generate binary RPM)z	use-bzip2Nz7use bzip2 instead of gzip to create source distribution)zdistribution-name=Nzgname of the (Linux) distribution to which this RPM applies (*not* the name of the module distribution!))zgroup=Nz9package classification [default: "Development/Libraries"])zrelease=NzRPM release number)zserial=NzRPM serial number)zvendor=NzaRPM "vendor" (eg. "Joe Blow <joe@example.com>") [default: maintainer or author from setup script])z	packager=NzBRPM packager (eg. "Jane Doe <jane@example.net>") [default: vendor])z
doc-files=Nz6list of documentation files (space or comma-separated))z
changelog=Nz
RPM changelog)zicon=Nzname of icon file)z	provides=Nz%capabilities provided by this package)z	requires=Nz%capabilities required by this package)z
conflicts=Nz-capabilities which conflict with this package)zbuild-requires=Nz+capabilities required to build this package)z
obsoletes=Nz*capabilities made obsolete by this package)�
no-autoreqNz+do not automatically calculate dependencies)�	keep-temp�kz"don't clean up RPM build directory)�no-keep-tempNz&clean up RPM build directory [default])�use-rpm-opt-flagsNz8compile with RPM_OPT_FLAGS when building from source RPM)�no-rpm-opt-flagsNz&do not pass any RPM CFLAGS to compiler)�	rpm3-modeNz"RPM 3 compatibility mode (default))�	rpm2-modeNzRPM 2 compatibility mode)zprep-script=Nz3Specify a script for the PREP phase of RPM building)z
build-script=Nz4Specify a script for the BUILD phase of RPM building)zpre-install=Nz:Specify a script for the pre-INSTALL phase of RPM building)zinstall-script=Nz6Specify a script for the INSTALL phase of RPM building)z
post-install=Nz;Specify a script for the post-INSTALL phase of RPM building)zpre-uninstall=Nz<Specify a script for the pre-UNINSTALL phase of RPM building)zpost-uninstall=Nz=Specify a script for the post-UNINSTALL phase of RPM building)z
clean-script=Nz4Specify a script for the CLEAN phase of RPM building)zverify-script=Nz6Specify a script for the VERIFY phase of the RPM build)zforce-arch=Nz0Force an architecture onto the RPM build process)�quiet�qz3Run the INSTALL phase of RPM building in quiet moderrrrr)rrrcCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_!d|_"d|_#d|_$d|_%d|_&dS)Nr�)'�
bdist_base�rpm_base�dist_dir�python�
fix_python�	spec_only�binary_only�source_only�	use_bzip2�distribution_name�group�release�serial�vendor�packager�	doc_files�	changelog�icon�prep_script�build_script�install_script�clean_script�
verify_script�pre_install�post_install�
pre_uninstall�post_uninstall�prep�provides�requires�	conflicts�build_requires�	obsoletes�	keep_temp�use_rpm_opt_flags�	rpm3_mode�
no_autoreq�
force_archr��self�r>�3/usr/lib64/python3.8/distutils/command/bdist_rpm.py�initialize_options�sNzbdist_rpm.initialize_optionscCs�|�dd�|jdkr6|js$td��tj�|jd�|_|jdkrX|j	rPt
j|_qfd|_n|j	rftd��tjdkr~t
dtj��|jr�|jr�td	��|j��s�d
|_|�dd�|��dS)NZbdist)rrz)you must specify --rpm-base in RPM 2 mode�rpmZpython3z8--python and --fix-python are mutually exclusive options�posixz9don't know how to create RPM distributions on platform %sz6cannot supply both '--source-only' and '--binary-only'r)rr)Zset_undefined_optionsrr9ZDistutilsOptionError�os�path�joinrrr�sys�
executable�nameZDistutilsPlatformErrorrr�distribution�has_ext_modulesr8�finalize_package_datar<r>r>r?�finalize_options�s6
�

�
��
zbdist_rpm.finalize_optionscCsT|�dd�|�dd|j��|j��f�|�d�|�d�t|jt�rxdD]&}tj	�
|�rP||jkrP|j�|�qP|�dd	�|�d
�|�d�|�d�|�|j
�|_
|�d
�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�dS)Nr zDevelopment/Librariesr#z%s <%s>r$r%)ZREADMEz
README.txtr!�1r"rr&r'r(r)r*r+r,r-r.r/r0r2r3r4r5r6r;)Z
ensure_stringrIZget_contactZget_contact_emailZensure_string_list�
isinstancer%�listrCrD�exists�append�_format_changelogr&Zensure_filename)r=Zreadmer>r>r?rK�sB
��



















zbdist_rpm.finalize_package_datacCs�tr<td�td|j�td|j�td|j�td|j�|jrT|j}|�|�n8i}dD]&}t	j
�|j|�||<|�||�q\|d}t	j
�|d|j
���}|�t||��fd	|�|jr�dS|j
jdd�}|�d
�}|jr�dg|_ndg|_|�d
�||j
_|��d
}|d}|�||�|j�rbt	j
�|j��rT|�|j|�ntd|j��t�d�dg}	|j�r�|	�d�n|j �r�|	�d�n
|	�d�|	�!dd|j"g�|j#�r�|	�!ddt	j
�$|j�g�|j%�s�|	�d�|j&�r|	�d�|	�|�d}
|
d}d|
d}d|||f}
t	�'|
�}z~g}d}|�)�}|�sV�q�|�*��+�}t,|�dk�stt-�|�|d �|dk�rD|d
}�qD|�(�}|�r�t.d!t/|
���W5|�(�X|�0|	�|j1�s�|j
�2��r�t3�}nd"}|j �sLt	j
�|d#|�}t	j
�|��st-�|�4||j�t	j
�|j|�}|j
j�d$||f�|j�s�|D]`}t	j
�|d%|�}t	j
�|��rX|�4||j�t	j
�|jt	j
�5|��}|j
j�d$||f��qXdS)&Nzbefore _get_package_data():zvendor =z
packager =zdoc_files =zchangelog =)�SOURCES�SPECSZBUILD�RPMS�SRPMSrTz%s.speczwriting '%s'�sdistZbztarZgztarrrSzicon file '%s' does not existz
building RPMsZrpmbuildz-bsz-bbz-baz--definez__python %sz
_topdir %sz--cleanz--quietz%{name}-%{version}-%{release}z.src.rpmz%{arch}/z.%{arch}.rpmz%rpm -q --qf '%s %s\n' --specfile '%s'�rzFailed to execute: %s�anyrVr	rU)6r�printr#r$r%r&rrZmkpathrCrDrErrI�get_nameZexecuter�_make_spec_fileZ
dist_filesZreinitialize_commandrZformatsZrun_commandZget_archive_filesZ	copy_filer'rPZDistutilsFileErrorr�inforrQr�extendrr9�abspathr7r�popen�close�readline�strip�split�len�AssertionErrorZDistutilsExecError�reprZspawnZdry_runrJrZ	move_file�basename)r=Zspec_dirZrpm_dirr
Z	spec_pathZsaved_dist_filesrW�sourceZ
source_dirZrpm_cmdZ
nvr_stringZsrc_rpmZnon_src_rpmZq_cmd�outZbinary_rpmsZ
source_rpm�line�lZstatusZ	pyversionZsrpm�filenamerAr>r>r?�runs����


�

�


�



�

��z
bdist_rpm.runcCstj�|jtj�|��S)N)rCrDrErrh)r=rDr>r>r?�
_dist_path�szbdist_rpm._dist_pathc
CsJd|j��d|j���dd�d|j��d|j�dd�dd|j��g}t�d	�}d
�dd�|�	�D��}d
}d}|�||�}||kr�|�
d�|�
d|d
�|�dddg�|jr�|�
d�n
|�
d�|�d|j�
�d|jddg�|j�s|j���s&|�
d�n|�
d|j�dD]V}t||���}t|t��rb|�
d|d�|�f�n|dk	�r*|�
d||f��q*|j��d k�r�|�
d!|j���|j�r�|�
d"|j�|j�r�|�
d#d�|j��|j�r�|�
d$tj�|j��|j�r|�
d%�|�dd&|j��g�d'|jtj�tj d(�f}d)|}	|j!�rXd*|	}	d+|}
d,d-d.|	fd/d0|
fd1d2d3d4d5d6g	}|D]n\}}
}t||
�}|�s�|�r�|�dd7|g�|�r�t"|��}|�|�#��$d
��W5QRXn
|�
|��q�|�dd8d9g�|j%�r$|�
d:d�|j%��|j&�rF|�dd;g�|�|j&�|S)<ziGenerate the text of an RPM spec file and return it as a
        list of strings (one per line).
        z
%define name z%define version �-�_z%define unmangled_version z%define release �z	Summary: zrpm --eval %{__os_install_post}�
cSsg|]}d|���qS)z  %s \)rc)�.0rkr>r>r?�
<listcomp>�s�z-bdist_rpm._make_spec_file.<locals>.<listcomp>zbrp-python-bytecompile \
z%brp-python-bytecompile %{__python} \
z2# Workaround for http://bugs.python.org/issue14443z%define __os_install_post z
Name: %{name}zVersion: %{version}zRelease: %{release}z-Source0: %{name}-%{unmangled_version}.tar.bz2z,Source0: %{name}-%{unmangled_version}.tar.gzz	License: zGroup: z>BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildrootzPrefix: %{_prefix}zBuildArch: noarchz
BuildArch: %s)ZVendorZPackagerZProvidesZRequiresZ	ConflictsZ	Obsoletesz%s: %s� NZUNKNOWNzUrl: zDistribution: zBuildRequires: zIcon: z
AutoReq: 0z%descriptionz%s %srz%s buildzenv CFLAGS="$RPM_OPT_FLAGS" z>%s install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES)r1r(z&%setup -n %{name}-%{unmangled_version}Zbuildr)Zinstallr*)Zcleanr+zrm -rf $RPM_BUILD_ROOT)Zverifyscriptr,N)Zprer-N)Zpostr.N)Zpreunr/N)Zpostunr0N�%z%files -f INSTALLED_FILESz%defattr(-,root,root)z%doc z
%changelog)'rIr[Zget_version�replacer!Zget_description�
subprocessZ	getoutputrE�
splitlinesrQr^rZget_licenser r;rJ�getattr�lowerrNrOZget_urlrr5r'rCrDrhr:Zget_long_descriptionrrF�argvr8�open�readrdr%r&)r=Z	spec_fileZvendor_hookZproblemZfixedZ
fixed_hookZfield�valZdef_setup_callZ	def_buildZinstall_cmdZscript_optionsZrpm_opt�attr�default�fr>r>r?r\�s��

�
	�
�

�
���
�
 ��zbdist_rpm._make_spec_filecCs||s|Sg}|���d�D]N}|��}|ddkrB|�d|g�q|ddkrZ|�|�q|�d|�q|dsx|d=|S)zKFormat the changelog correctly and convert it to a list of strings
        rsrrrrrpz  )rcrdr^rQ)r=r&Z
new_changelogrkr>r>r?rR1szbdist_rpm._format_changelogN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optr@rLrKrnror\rRr>r>r>r?r	sx�m��--*r	)�__doc__ryrFrCZdistutils.corerZdistutils.debugrZdistutils.utilrZdistutils.file_utilrZdistutils.errorsZdistutils.sysconfigrZ	distutilsrr	r>r>r>r?�<module>s__pycache__/build.cpython-38.pyc000064400000007453150513660060012516 0ustar00U

e5d��@sTdZddlZddlZddlmZddlmZddlmZdd�Z	Gdd	�d	e�Z
dS)
zBdistutils.command.build

Implements the Distutils 'build' command.�N)�Command)�DistutilsOptionError)�get_platformcCsddlm}|�dS)Nr��show_compilers)Zdistutils.ccompilerrr�r�//usr/lib64/python3.8/distutils/command/build.pyrsrc@s�eZdZdZdddddddd	d
e�fddd
ddgZddgZdddefgZdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd �Zd!d"�Zd#efd$e
fd%efd&efgZdS)'�buildz"build everything needed to install)zbuild-base=�bz base directory for build library)zbuild-purelib=Nz2build directory for platform-neutral distributions)zbuild-platlib=Nz3build directory for platform-specific distributions)z
build-lib=NzWbuild directory for all distribution (defaults to either build-purelib or build-platlib)zbuild-scripts=Nzbuild directory for scripts)zbuild-temp=�tztemporary build directoryz
plat-name=�pz6platform name to build for, if supported (default: %s))z	compiler=�czspecify the compiler type)z	parallel=�jznumber of parallel build jobs)�debug�gz;compile extensions and libraries with debugging information)�force�fz2forcibly build everything (ignore file timestamps))zexecutable=�ez5specify final destination interpreter path (build.py)rrz
help-compilerNzlist available compilerscCsLd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_dS)Nr	r)�
build_base�
build_purelib�
build_platlib�	build_lib�
build_temp�
build_scriptsZcompiler�	plat_namerr�
executable�parallel��selfrrr�initialize_options8szbuild.initialize_optionscCsb|jdkrt�|_ntjdkr&td��d|jftjdd��}ttd�rR|d7}|jdkrntj	�
|jd�|_|jdkr�tj	�
|jd|�|_|j
dkr�|jjr�|j|_
n|j|_
|jdkr�tj	�
|jd|�|_|jdkr�tj	�
|jd	tjdd��|_|jdk�r tj�r tj	�tj�|_t|jt��r^zt|j�|_Wntk
�r\td
��YnXdS)N�ntzW--plat-name only supported on Windows (try using './configure --help' on your platform)z	.%s-%d.%d�Zgettotalrefcountz-pydebug�libZtempz
scripts-%d.%dzparallel should be an integer)rr�os�namer�sys�version_info�hasattrr�path�joinrrr�distributionZext_modulesrrr�normpath�
isinstancer�str�int�
ValueError)rZplat_specifierrrr�finalize_optionsHsD


�



�



�

�zbuild.finalize_optionscCs|��D]}|�|�qdS�N)Zget_sub_commandsZrun_command)rZcmd_namerrr�run�sz	build.runcCs
|j��Sr1)r*�has_pure_modulesrrrrr3�szbuild.has_pure_modulescCs
|j��Sr1)r*�has_c_librariesrrrrr4�szbuild.has_c_librariescCs
|j��Sr1)r*�has_ext_modulesrrrrr5�szbuild.has_ext_modulescCs
|j��Sr1)r*�has_scriptsrrrrr6�szbuild.has_scriptsZbuild_pyZ
build_clibZ	build_extr)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsrr0r2r3r4r5r6Zsub_commandsrrrrr	sH�����8�r	)�__doc__r%r#Zdistutils.corerZdistutils.errorsrZdistutils.utilrrr	rrrr�<module>s__pycache__/build_scripts.cpython-38.opt-2.pyc000064400000007534150513660060015225 0ustar00U

e5dX�@s�ddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZmZddlm
Z
ddlZe�d�ZGd	d
�d
e�ZGdd�dee�ZdS)
�N)�ST_MODE)�	sysconfig)�Command)�newer)�convert_path�	Mixin2to3)�logs^#!.*python[0-9.]*([ 	].*)?$c@sHeZdZdZdddgZdgZdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�
build_scriptsz("build" scripts (copy and fixup #! line))z
build-dir=�dzdirectory to "build" (copy) to)�force�fz1forcibly build everything (ignore file timestamps)zexecutable=�ez*specify final destination interpreter pathrcCs"d|_d|_d|_d|_d|_dS�N)�	build_dir�scriptsr�
executable�outfiles��self�r�7/usr/lib64/python3.8/distutils/command/build_scripts.py�initialize_optionss
z build_scripts.initialize_optionscCs|�dddd�|jj|_dS)NZbuild)r	r)rr)rr)Zset_undefined_optionsZdistributionrrrrr�finalize_options%s�zbuild_scripts.finalize_optionscCs|jSr)rrrrr�get_source_files,szbuild_scripts.get_source_filescCs|js
dS|��dSr)r�copy_scriptsrrrr�run/szbuild_scripts.runc
Cs�|�|j�g}g}|jD�]}d}t|�}tj�|jtj�|��}|�|�|j	slt
||�slt�d|�qzt
|d�}Wn tk
r�|js��d}YnXXt�|j�\}}|�d�|��}	|	s�|�d|�qt�|	�}
|
r�d}|
�d�p�d}|�rt�d	||j�|�|�|j�stj�s*|j}n(tj�t�d
�dt�d�t�d
�f�}t�|�}d||d}
z|
�d�Wn$tk
�r�t d�!|
���YnXz|
�|�Wn&tk
�r�t d�!|
|���YnXt
|d��}|�"|
�|�#|�$��W5QRX|�r8|�%�q|�r"|�%�|�|�|�&||�qtj'dk�r�|D]`}|j�rdt�d|�nDt�(|�t)d@}|dBd@}||k�rJt�d|||�t�*||��qJ||fS)NFznot copying %s (up-to-date)�rbrz%s is an empty file (skipping)T��zcopying and adjusting %s -> %sZBINDIRz
python%s%sZVERSIONZEXEs#!�
zutf-8z.The shebang ({!r}) is not decodable from utf-8zAThe shebang ({!r}) is not decodable from the script encoding ({})�wb�posixzchanging mode of %si�imz!changing mode of %s from %o to %o)+Zmkpathrrr�os�path�join�basename�appendrrr�debug�open�OSError�dry_run�tokenize�detect_encoding�readline�seek�warn�
first_line_re�match�group�inforZpython_buildrZget_config_var�fsencode�decode�UnicodeDecodeError�
ValueError�format�write�
writelines�	readlines�closeZ	copy_file�name�statr�chmod)rr�
updated_filesZscriptZadjustZoutfiler�encoding�linesZ
first_liner1Zpost_interprZshebangZoutf�fileZoldmodeZnewmoderrrr5s�



�

��
��
��




�zbuild_scripts.copy_scriptsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrrrrrrrr	s�r	c@seZdZdd�ZdS)�build_scripts_2to3cCs&t�|�\}}|js|�|�||fSr)r	rr*Zrun_2to3)rrr@rrrr�s
zbuild_scripts_2to3.copy_scriptsN)rDrErFrrrrrrG�srG)r"�rer>rZ	distutilsrZdistutils.corerZdistutils.dep_utilrZdistutils.utilrrrr+�compiler0r	rGrrrr�<module>s

__pycache__/build_clib.cpython-38.opt-1.pyc000064400000011320150513660060014432 0ustar00U

e5dV�@sTdZddlZddlmZddlTddlmZddlmZdd�Z	Gd	d
�d
e�Z
dS)z�distutils.command.build_clib

Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module.�N)�Command)�*)�customize_compiler)�logcCsddlm}|�dS)Nr��show_compilers)�distutils.ccompilerrr�r	�4/usr/lib64/python3.8/distutils/command/build_clib.pyrsrc@sleZdZdZdddddgZddgZd	d
defgZdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zd
S)�
build_clibz/build C/C++ libraries used by Python extensions)zbuild-clib=�bz%directory to build C/C++ libraries to)zbuild-temp=�tz,directory to put temporary build by-products)�debug�gz"compile with debugging information)�force�fz2forcibly build everything (ignore file timestamps))z	compiler=�czspecify the compiler typerrz
help-compilerNzlist available compilerscCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	r�
build_temp�	libraries�include_dirs�define�undefrr�compiler��selfr	r	r
�initialize_options4szbuild_clib.initialize_optionscCsh|�dddddd�|jj|_|jr0|�|j�|jdkrH|jjpDg|_t|jt�rd|j�tj	�|_dS)NZbuild)rr)rr)rr)rr)rr)
Zset_undefined_optionsZdistributionr�check_library_listr�
isinstance�str�split�os�pathseprr	r	r
�finalize_optionsDs�

zbuild_clib.finalize_optionscCs�|js
dSddlm}||j|j|jd�|_t|j�|jdk	rN|j�|j�|j	dk	rv|j	D]\}}|j�
||�q^|jdk	r�|jD]}|j�|�q�|�
|j�dS)Nr)�new_compiler)r�dry_runr)rrr#rr$rrrZset_include_dirsrZdefine_macrorZundefine_macro�build_libraries)rr#�name�valueZmacror	r	r
�run^s"�




zbuild_clib.runcCs�t|t�std��|D]z}t|t�s8t|�dkr8td��|\}}t|t�sRtd��d|ksntjdkr~tj|kr~td|d��t|t�std��qd	S)
a`Ensure that the list of libraries is valid.

        `library` is presumably provided as a command option 'libraries'.
        This method checks that it is a list of 2-tuples, where the tuples
        are (library_name, build_info_dict).

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z+'libraries' option must be a list of tuples�z*each element of 'libraries' must a 2-tuplezNfirst element of each tuple in 'libraries' must be a string (the library name)�/z;bad library name '%s': may not contain directory separatorsrzMsecond element of each tuple in 'libraries' must be a dictionary (build info)N)	r�list�DistutilsSetupError�tuple�lenrr �sep�dict)rr�libr&�
build_infor	r	r
rvs,

��
��
�zbuild_clib.check_library_listcCs,|js
dSg}|jD]\}}|�|�q|S)N)r�append)rZ	lib_names�lib_namer2r	r	r
�get_library_names�szbuild_clib.get_library_namescCsZ|�|j�g}|jD]>\}}|�d�}|dks>t|ttf�sJtd|��|�|�q|S)N�sources�fin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames)rr�getrr+r-r,�extend)r�	filenamesr4r2r6r	r	r
�get_source_files�s
��zbuild_clib.get_source_filescCs�|D]�\}}|�d�}|dks,t|ttf�s8td|��t|�}t�d|�|�d�}|�d�}|jj||j	|||j
d�}|jj|||j|j
d�qdS)Nr6r7zbuilding '%s' library�macrosr)�
output_dirr<rr)r=r)
r8rr+r-r,r�infor�compilerrZcreate_static_libr)rrr4r2r6r<rZobjectsr	r	r
r%�s,
��

�	
�zbuild_clib.build_libraries)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrZhelp_optionsrr"r(rr5r;r%r	r	r	r
rs(�
��$r)�__doc__r Zdistutils.corerZdistutils.errorsZdistutils.sysconfigrZ	distutilsrrrr	r	r	r
�<module>s__pycache__/upload.cpython-38.opt-1.pyc000064400000012100150513660060013623 0ustar00U

&�.e��@s�dZddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
ddlmZddl
mZmZddlmZddlmZdd	lmZGd
d�de�ZdS)zm
distutils.command.upload

Implements the Distutils 'upload' subcommand (upload package to a package
index).
�N)�standard_b64encode)�urlopen�Request�	HTTPError)�urlparse)�DistutilsError�DistutilsOptionError)�
PyPIRCCommand)�spawn)�logc@sJeZdZdZejddgZejdgZdd�Zdd�Zd	d
�Z	dd�Z
d
S)�uploadzupload binary package to PyPI)�sign�szsign files to upload using gpg)z	identity=�izGPG identity used to sign filesr
cCs,t�|�d|_d|_d|_d|_d|_dS)N�rF)r	�initialize_options�username�password�
show_responser
�identity)�self�r�0/usr/lib64/python3.8/distutils/command/upload.pyr s
zupload.initialize_optionscCsrt�|�|jr|jstd��|��}|ikrV|d|_|d|_|d|_|d|_	|jsn|j
jrn|j
j|_dS)Nz.Must use --sign for --identity to have meaningrr�
repository�realm)r	�finalize_optionsrr
rZ_read_pypircrrrr�distribution)rZconfigrrrr(s
�



zupload.finalize_optionscCs:|jjsd}t|��|jjD]\}}}|�|||�qdS)NzHMust create and upload files in one command (e.g. setup.py sdist upload))rZ
dist_filesr�upload_file)r�msg�command�	pyversion�filenamerrr�run:s
z
upload.runc"Cst|j�\}}}}}}	|s"|s"|	r0td|j��|dkrDtd|��|jr|ddd|g}
|jrnd|jg|
dd�<t|
|jd	�t|d
�}z|�	�}W5|��X|j
j}
dd|
��|
�
�tj�|�|f||t�|���d
|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
� �d�}zt�!|���}WnPt"k
�r�}z0d|}|�#|t$j%�ddl&m'}|��s|�W5d}~XYn
X||d<d|d<|j�r�t|dd
��"}tj�|�d|�	�f|d<W5QRX|j(d|j)�*d�}dt+|��,d�}d}d|�*d�}|d}t-�.�}|�/�D]�\}}d|}t0|t1��sP|g}|D]j}t2|�t3k�r�|d|d7}|d}nt4|��*d �}|�5|�|�5|�*d ��|�5d!�|�5|��qT�q.|�5|�|�6�}d"||jf}|�#|t$j%�d#|t4t7|��|d$�}t8|j||d%�}zt9|�}|�:�}|j;} Wnft<k
�rd}z|j=}|j;} W5d}~XYn8t>k
�r�}z|�#t4|�t$j?��W5d}~XYnX|d&k�r�|�#d'|| ft$j%�|j@�r|�A|�}!d(�Bd)|!d)f�}|�#|t$j%�n"d*|| f}|�#|t$j?�tC|��dS)+NzIncompatible url %s)ZhttpZhttpszunsupported schema Zgpgz
--detach-signz-az--local-user�)�dry_run�rbZfile_upload�1z1.0)z:actionZprotocol_version�name�version�contentZfiletyper Z
sha256_digestZmetadata_versionZsummaryZ	home_pageZauthorZauthor_email�license�description�keywords�platformZclassifiersZdownload_urlZprovidesZrequiresZ	obsoletesz#calculating md5 checksum failed: %sr)�
get_fips_modeZ
md5_digestrZcommentz.ascZ
gpg_signature�:�asciizBasic z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s
--s--
z+
Content-Disposition: form-data; name="%s"z; filename="%s"�zutf-8s

zSubmitting %s to %sz multipart/form-data; boundary=%s)zContent-typezContent-lengthZ
Authorization)�data�headers��zServer response (%s): %s�
zK---------------------------------------------------------------------------zUpload failed (%s): %s)Drr�AssertionErrorr
rr
r$�open�close�readrZmetadataZget_nameZget_version�os�path�basename�hashlibZsha256Z	hexdigestZget_descriptionZget_urlZget_contactZget_contact_emailZget_licenceZget_long_descriptionZget_keywordsZ
get_platformsZget_classifiersZget_download_urlZget_providesZget_requiresZ
get_obsoletesZmd5�
ValueErrorZannouncer�INFOZ_hashlibr.rr�encoder�decode�io�BytesIO�items�
isinstance�list�type�tuple�str�write�getvalue�lenrrZgetcoderr�code�OSErrorZERRORrZ_read_pypi_response�joinr)"rrr r!ZschemaZnetlocZurlZparamsZqueryZ	fragmentsZgpg_args�fr)�metar2Zdigest�err.Z	user_passZauth�boundaryZsep_boundaryZend_boundaryZbody�key�value�titler3Zrequest�resultZstatus�reason�textrrrrBs���

�!�




��

�
zupload.upload_fileN)�__name__�
__module__�__qualname__r+r	Zuser_optionsZboolean_optionsrrr"rrrrrrs�r)�__doc__r:rBr-r=�base64rZurllib.requestrrrZurllib.parserZdistutils.errorsrrZdistutils.corer	Zdistutils.spawnr
Z	distutilsrrrrrr�<module>s__pycache__/clean.cpython-38.opt-2.pyc000064400000003743150513660060013437 0ustar00U

e5d�
�@s@ddlZddlmZddlmZddlmZGdd�de�ZdS)�N)�Command)�remove_tree)�logc@s>eZdZdZddddddgZdgZd	d
�Zdd�Zd
d�ZdS)�cleanz-clean up temporary files from 'build' command)zbuild-base=�bz2base build directory (default: 'build.build-base'))z
build-lib=Nz<build directory for all modules (default: 'build.build-lib'))zbuild-temp=�tz7temporary build directory (default: 'build.build-temp'))zbuild-scripts=Nz<build directory for scripts (default: 'build.build-scripts'))zbdist-base=Nz+temporary directory for built distributions)�all�az7remove all build output, not just temporary by-productsrcCs(d|_d|_d|_d|_d|_d|_dS)N)�
build_base�	build_lib�
build_temp�
build_scripts�
bdist_baser��self�r�//usr/lib64/python3.8/distutils/command/clean.py�initialize_options szclean.initialize_optionscCs"|�ddddd�|�dd�dS)NZbuild)r
r
)rr)r
r
)rrZbdist)rr)Zset_undefined_optionsrrrr�finalize_options(s��zclean.finalize_optionscCs�tj�|j�r t|j|jd�nt�d|j�|jrr|j	|j
|jfD],}tj�|�rdt||jd�qDt�d|�qD|js�zt�
|j�t�d|j�Wntk
r�YnXdS)N)�dry_runz%'%s' does not exist -- can't clean itz
removing '%s')�os�path�existsrrrr�debugrrrr
�warn�rmdirr
�info�OSError)rZ	directoryrrr�run1s*���z	clean.runN)	�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrrrrrrs�	r)rZdistutils.corerZdistutils.dir_utilrZ	distutilsrrrrrr�<module>s__pycache__/install_scripts.cpython-38.pyc000064400000004137150513660060014630 0ustar00U

e5d��@sDdZddlZddlmZddlmZddlmZGdd�de�ZdS)zudistutils.command.install_scripts

Implements the Distutils 'install_scripts' command, for installing
Python scripts.�N)�Command)�log)�ST_MODEc@sLeZdZdZddddgZddgZdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�install_scriptsz%install scripts (Python or otherwise))zinstall-dir=�dzdirectory to install scripts to)z
build-dir=�bz'build directory (where to install from))�force�fz-force installation (overwrite existing files))�
skip-buildNzskip the build stepsrr
cCsd|_d|_d|_d|_dS)Nr)�install_dirr�	build_dir�
skip_build��self�r�9/usr/lib64/python3.8/distutils/command/install_scripts.py�initialize_optionssz"install_scripts.initialize_optionscCs |�dd�|�dddd�dS)NZbuild)�
build_scriptsrZinstall)rr)rr)r
r
)Zset_undefined_optionsrrrr�finalize_options!s�z install_scripts.finalize_optionscCs�|js|�d�|�|j|j�|_tjdkr~|��D]H}|j	rLt
�d|�q4t�|�t
dBd@}t
�d||�t�||�q4dS)Nr�posixzchanging mode of %simi�zchanging mode of %s to %o)r
Zrun_commandZ	copy_treerr�outfiles�os�name�get_outputsZdry_runr�info�statr�chmod)r�file�moderrr�run)s

zinstall_scripts.runcCs|jjp
gS�N)ZdistributionZscriptsrrrr�
get_inputs8szinstall_scripts.get_inputscCs
|jpgSr )rrrrrr;szinstall_scripts.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrr!rrrrrrs�r)	�__doc__rZdistutils.corerZ	distutilsrrrrrrrr�<module>s
__pycache__/bdist.cpython-38.opt-1.pyc000064400000007124150513660060013456 0ustar00U

e5d��@sHdZddlZddlmZddlTddlmZdd�ZGdd	�d	e�ZdS)
zidistutils.command.bdist

Implements the Distutils 'bdist' command (create a built [binary]
distribution).�N)�Command)�*)�get_platformcCsPddlm}g}tjD]"}|�d|dtj|df�q||�}|�d�dS)zFPrint list of available formats (arguments to "--format" option).
    r)�FancyGetopt�formats=N�z'List of available distribution formats:)Zdistutils.fancy_getoptr�bdist�format_commands�append�format_commandZ
print_help)r�formats�formatZpretty_printer�r�//usr/lib64/python3.8/distutils/command/bdist.py�show_formatss
�rc
@s�eZdZdZdddde�fdddd	d
gZdgZdd
defgZdZ	ddd�Z
dddddddddg	Zddddddd d!d"d#�	Zd$d%�Z
d&d'�Zd(d)�Zd
S)*rz$create a built (binary) distribution)zbdist-base=�bz4temporary directory for creating built distributionsz
plat-name=�pz;platform name to embed in generated filenames (default: %s))rNz/formats for distribution (comma-separated list))z	dist-dir=�dz=directory to put final built distributions in [default: dist])�
skip-buildNz2skip rebuilding everything (for testing/debugging))zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]rzhelp-formatsNz$lists available distribution formats)�	bdist_rpm�gztar�zip)�posix�nt�rpm�bztar�xztar�ztar�tar�wininst�msi)rzRPM distribution)�
bdist_dumbzgzip'ed tar file)r#zbzip2'ed tar file)r#zxz'ed tar file)r#zcompressed tar file)r#ztar file)Z
bdist_wininstzWindows executable installer)r#zZIP file)Z	bdist_msizMicrosoft Installer)	rrrrrr r!rr"cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr)�
bdist_base�	plat_namer�dist_dir�
skip_build�group�owner)�selfrrr�initialize_optionsQszbdist.initialize_optionscCs�|jdkr(|jrt�|_n|�d�j|_|jdkrT|�d�j}tj�|d|j�|_|�	d�|j
dkr�z|jtjg|_
Wn"t
k
r�tdtj��YnX|jdkr�d|_dS)NZbuildzbdist.rz;don't know how to create built distributions on platform %sZdist)r%r'rZget_finalized_commandr$�
build_base�os�path�joinZensure_string_listr�default_format�name�KeyErrorZDistutilsPlatformErrorr&)r*r,rrr�finalize_optionsZs*


�

��

zbdist.finalize_optionsc	Cs�g}|jD]>}z|�|j|d�Wq
tk
rFtd|��Yq
Xq
tt|j��D]h}||}|�|�}||jkr�|j||_	|dkr�|j
|_
|j|_|||dd�kr�d|_|�
|�qXdS)Nrzinvalid format '%s'r#r)rr
rr2ZDistutilsOptionError�range�lenZreinitialize_command�no_format_optionr
r)r(Z	keep_tempZrun_command)r*Zcommandsr
�iZcmd_nameZsub_cmdrrr�runvs"


z	bdist.run)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsr6r0r	rr+r3r8rrrrrsR��������
	r)	�__doc__r-Zdistutils.corerZdistutils.errorsZdistutils.utilrrrrrrr�<module>s__pycache__/build_py.cpython-38.pyc000064400000024362150513660060013224 0ustar00U

e5d&C�@szdZddlZddlZddlZddlZddlmZddlTddl	m
Z
mZddlm
Z
Gdd�de�ZGd	d
�d
ee�ZdS)zHdistutils.command.build_py

Implements the Distutils 'build_py' command.�N)�Command)�*)�convert_path�	Mixin2to3)�logc@s�eZdZdZdddddgZddgZd	diZd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd2d'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1S)3�build_pyz5"build" pure Python modules (copy to build directory))z
build-lib=�dzdirectory to "build" (copy) to)�compile�czcompile .py to .pyc)�
no-compileNz!don't compile .py files [default])z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�force�fz2forcibly build everything (ignore file timestamps)r	r
rcCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)�	build_lib�
py_modules�package�package_data�package_dirr	�optimizer
��self�r�2/usr/lib64/python3.8/distutils/command/build_py.py�initialize_options szbuild_py.initialize_optionsc	Cs�|�ddd�|jj|_|jj|_|jj|_i|_|jjr^|jj��D]\}}t|�|j|<qF|��|_	t
|jt�s�z,t|j�|_d|jkr�dks�nt
�Wn tt
fk
r�td��YnXdS)NZbuild)rr)r
r
r�zoptimize must be 0, 1, or 2)Zset_undefined_options�distribution�packagesrrr�itemsr�get_data_files�
data_files�
isinstancer�int�AssertionError�
ValueErrorZDistutilsOptionError)r�name�pathrrr�finalize_options*s$�



 zbuild_py.finalize_optionscCs:|jr|��|jr$|��|��|�|jdd��dS�Nr)�include_bytecode)r�
build_modulesr�build_packages�build_package_data�byte_compile�get_outputsrrrr�runCszbuild_py.runcs�g}|js|S|jD]h}|�|�}tjj|jg|�d��}d�|rPt|�d��fdd�|�||�D�}|�	||||f�q|S)z?Generate list of '(package,src_dir,build_dir,filenames)' tuples�.r�csg|]}|�d��qS�Nr)�.0�file�Zplenrr�
<listcomp>ssz+build_py.get_data_files.<locals>.<listcomp>)
r�get_package_dir�osr%�joinr�split�len�find_data_files�append)r�datar�src_dir�	build_dir�	filenamesrr4rras



�zbuild_py.get_data_filescsd|j�dg�|j�|g�}g�|D]:}t�tj�t�|�t|���}���fdd�|D��q$�S)z6Return filenames for package's data files in 'src_dir'�cs$g|]}|�krtj�|�r|�qSr)r7r%�isfile)r2�fn��filesrrr5�s�z,build_py.find_data_files.<locals>.<listcomp>)	r�get�globr7r%r8�escaper�extend)rrr>Zglobs�patternZfilelistrrDrr;ys�zbuild_py.find_data_filescCs`d}|jD]P\}}}}|D]>}tj�||�}|�tj�|��|jtj�||�|dd�qq
dS)z$Copy data files into build directoryNF�Z
preserve_mode)rr7r%r8�mkpath�dirname�	copy_file)rZlastdirrr>r?r@�filename�targetrrrr+�s�zbuild_py.build_package_datacCs�|�d�}|js&|r tjj|�SdSn�g}|r�z|jd�|�}Wn*tk
rl|�d|d�|d=Yq*X|�d|�tjj|�Sq*|j�d�}|dk	r�|�d|�|r�tjj|�SdSdS)z�Return the directory, relative to the top of the source
           distribution, where package 'package' should be found
           (at least according to the 'package_dir' option, if any).r/rAr���N)r9rr7r%r8�KeyError�insertrF)rrr%�tailZpdirrrrr6�s(
	zbuild_py.get_package_dircCsj|dkr8tj�|�s td|��tj�|�s8td|��|rftj�|d�}tj�|�rZ|St�d|�dS)NrAz%package directory '%s' does not existz>supposed package directory '%s' exists, but is not a directoryz__init__.pyz8package init file '%s' not found (or not a regular file))	r7r%�existsZDistutilsFileError�isdirr8rBr�warn)rrr�init_pyrrr�
check_package�s&����zbuild_py.check_packagecCs&tj�|�st�d||�dSdSdS)Nz!file %s (for module %s) not foundFT)r7r%rBrrW)r�module�module_filerrr�check_module�szbuild_py.check_modulec	Cs�|�||�t�tj�t�|�d��}g}tj�|jj�}|D]P}tj�|�}||kr�tj�	tj�
|��d}|�|||f�q>|�d|�q>|S)Nz*.pyrzexcluding %s)
rYrGr7r%r8rH�abspathrZscript_name�splitext�basenamer<Zdebug_print)	rrrZmodule_files�modulesZsetup_scriptrZabs_frZrrr�find_package_modules�szbuild_py.find_package_modulesc	Cs�i}g}|jD]�}|�d�}d�|dd��}|d}z||\}}Wn"tk
rh|�|�}d}YnX|s�|�||�}	|df||<|	r�|�|d|	f�tj�||d�}
|�	||
�s�q|�|||
f�q|S)a�Finds individually-specified Python modules, ie. those listed by
        module name in 'self.py_modules'.  Returns a list of tuples (package,
        module_base, filename): 'package' is a tuple of the path through
        package-space to the module; 'module_base' is the bare (no
        packages, no dots) module name, and 'filename' is the path to the
        ".py" file (relative to the distribution root) that implements the
        module.
        r/rrQr0�__init__�.py)
rr9r8rRr6rYr<r7r%r\)rrr`rZr%rZmodule_baser�checkedrXr[rrr�find_modules�s*



zbuild_py.find_modulescCsNg}|jr|�|���|jrJ|jD]$}|�|�}|�||�}|�|�q$|S)a4Compute the list of all modules that will be built, whether
        they are specified one-module-at-a-time ('self.py_modules') or
        by whole packages ('self.packages').  Return a list of tuples
        (package, module, module_file), just like 'find_modules()' and
        'find_package_modules()' do.)rrIrerr6ra)rr`rr�mrrr�find_all_moduless

zbuild_py.find_all_modulescCsdd�|��D�S)NcSsg|]}|d�qS)rQr)r2rZrrrr5-sz-build_py.get_source_files.<locals>.<listcomp>)rgrrrr�get_source_files,szbuild_py.get_source_filescCs$|gt|�|dg}tjj|�S)Nrc)�listr7r%r8)rr?rrZZoutfile_pathrrr�get_module_outfile/szbuild_py.get_module_outfiler0cCs�|��}g}|D]p\}}}|�d�}|�|j||�}|�|�|r|jr^|�tjj|dd��|j	dkr|�tjj||j	d��q|dd�|j
D�7}|S)Nr/rA)�optimizationrcSs,g|]$\}}}}|D]}tj�||��qqSr)r7r%r8)r2rr>r?r@rOrrrr5Bs
�z(build_py.get_outputs.<locals>.<listcomp>)rgr9rjrr<r	�	importlib�util�cache_from_sourcerr)rr(r`ZoutputsrrZr[rOrrrr-3s*


�

�
�zbuild_py.get_outputscCsbt|t�r|�d�}nt|ttf�s,td��|�|j||�}tj	�
|�}|�|�|j||dd�S)Nr/z:'package' must be a string (dot-separated), list, or tuplerrK)
r �strr9ri�tuple�	TypeErrorrjrr7r%rMrLrN)rrZr[rZoutfile�dirrrr�build_moduleJs
�
zbuild_py.build_modulecCs*|��}|D]\}}}|�|||�qdSr1)rers)rr`rrZr[rrrr)Yszbuild_py.build_modulescCsP|jD]D}|�|�}|�||�}|D]$\}}}||ks:t�|�|||�q$qdSr1)rr6rar"rs)rrrr`Zpackage_rZr[rrrr*bs


zbuild_py.build_packagescCs�tjr|�d�dSddlm}|j}|dtjkr>|tj}|jrZ||d|j	||j
d�|jdkr||||j|j	||j
d�dS)Nz%byte-compiling is disabled, skipping.r)r,rQ)rr
�prefix�dry_run)�sys�dont_write_bytecoderW�distutils.utilr,rr7�sepr	r
rur)rrEr,rtrrrr,vs&

�
�zbuild_py.byte_compileN)r0)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optrr&r.rr;r+r6rYr\rarergrhrjr-rsr)r*r,rrrrrs8�



'4
	rc@seZdZdd�Zdd�ZdS)�
build_py_2to3cCsLg|_|jr|��|jr*|��|��|�|j�|�|jdd��dSr')	�
updated_filesrr)rr*r+Zrun_2to3r,r-rrrrr.�szbuild_py_2to3.runcCs,t�||||�}|dr(|j�|d�|S)Nr0r)rrsr~r<)rrZr[r�resrrrrs�szbuild_py_2to3.build_moduleN)rzr{r|r.rsrrrrr}�sr})�__doc__r7�importlib.utilrlrvrGZdistutils.corerZdistutils.errorsrxrrZ	distutilsrrr}rrrr�<module>s}__pycache__/bdist_dumb.cpython-38.opt-2.pyc000064400000006502150513660060014465 0ustar00U

e5d1�@sdddlZddlmZddlmZddlmZmZddlTddl	m
Z
ddlmZGdd	�d	e�Z
dS)
�N)�Command)�get_platform)�remove_tree�ensure_relative)�*)�get_python_version)�logc	@s^eZdZdZdddde�fdddd	d
ddg	Zd
ddgZddd�Zdd�Zdd�Z	dd�Z
dS)�
bdist_dumbz"create a "dumb" built distribution)z
bdist-dir=�dz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))zformat=�fz>archive format to create (tar, gztar, bztar, xztar, ztar, zip))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)z	dist-dir=r
z-directory to put final built distributions in)�
skip-buildNz2skip rebuilding everything (for testing/debugging))�relativeNz7build the archive using relative paths (default: false))zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]r
rrZgztar�zip)�posix�ntcCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	�	bdist_dir�	plat_name�format�	keep_temp�dist_dir�
skip_buildr�owner�group)�self�r�4/usr/lib64/python3.8/distutils/command/bdist_dumb.py�initialize_options2szbdist_dumb.initialize_optionscCsz|jdkr&|�d�j}tj�|d�|_|jdkrfz|jtj|_Wn"t	k
rdt
dtj��YnX|�dddd�dS)NZbdistZdumbz@don't know how to create dumb built distributions on platform %s)rr)rr)rr)rZget_finalized_command�
bdist_base�os�path�joinr�default_format�name�KeyError�DistutilsPlatformErrorZset_undefined_options)rr"rrr �finalize_options=s"

��
�zbdist_dumb.finalize_optionscCs(|js|�d�|jddd�}|j|_|j|_d|_t�d|j�|�d�d|j�	�|j
f}tj�
|j|�}|js~|j}nJ|j��r�|j|jkr�tdt|j�t|j�f��ntj�
|jt|j��}|j||j||j|jd	�}|j��r�t�}nd
}|jj�d||f�|j�s$t|j|jd�dS)
NZbuild�install�)Zreinit_subcommandsrzinstalling to %sz%s.%szScan't make a dumb built distribution where base and platbase are different (%s, %s))Zroot_dirrr�anyr	)�dry_run) rZrun_commandZreinitialize_commandr�rootZwarn_dirr�infoZdistributionZget_fullnamerr#r$r%rrZhas_ext_modulesZinstall_baseZinstall_platbaser)�reprrZmake_archiverrrrZ
dist_files�appendrrr.)rr+Zarchive_basenameZpseudoinstall_rootZarchive_root�filenameZ	pyversionrrr �runOsR


�

����
��
�zbdist_dumb.runN)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsr&r!r*r4rrrr r	s,���
�r	)r#Zdistutils.corerZdistutils.utilrZdistutils.dir_utilrrZdistutils.errorsZdistutils.sysconfigrZ	distutilsrr	rrrr �<module>s__pycache__/check.cpython-38.opt-1.pyc000064400000011427150513660060013427 0ustar00U

e5d��@s�dZddlmZddlmZzTddlmZddlmZddl	m
Z
ddl	mZddlm
Z
Gd	d
�d
e�ZdZWnek
r�dZYnXGd
d�de�ZdS)zCdistutils.command.check

Implements the Distutils 'check' command.
�)�Command)�DistutilsSetupError)�Reporter)�Parser)�frontend)�nodes)�StringIOc@seZdZd	dd�Zdd�ZdS)
�SilentReporterNr�ascii�replacec
Cs"g|_t�||||||||�dS�N)�messagesr�__init__)�self�source�report_level�
halt_level�stream�debug�encoding�
error_handler�r�//usr/lib64/python3.8/distutils/command/check.pyrs�zSilentReporter.__init__cOs6|j�||||f�tj|f|�||j|d�|��S)N)�level�type)r
�appendr�system_messageZlevels)rr�messageZchildren�kwargsrrrrs���zSilentReporter.system_message)Nrr
r)�__name__�
__module__�__qualname__rrrrrrr	s�
r	TFc@s`eZdZdZdZdddgZdddgZd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�checkz6This command checks the meta-data of the package.
    z"perform some checks on the package)�metadata�mzVerify meta-data)�restructuredtext�rzEChecks if long string meta-data syntax are reStructuredText-compliant)�strict�sz(Will exit with an error if a check failsr#r%r'cCsd|_d|_d|_d|_dS)z Sets default values for options.r�N)r%r#r'�	_warnings�rrrr�initialize_options1szcheck.initialize_optionscCsdSrrr+rrr�finalize_options8szcheck.finalize_optionscCs|jd7_t�||�S)z*Counts the number of warnings that occurs.r))r*r�warn)r�msgrrrr.;sz
check.warncCsL|jr|��|jr0tr"|��n|jr0td��|jrH|jdkrHtd��dS)zRuns the command.zThe docutils package is needed.rzPlease correct your package.N)r#�check_metadatar%�HAS_DOCUTILS�check_restructuredtextr'rr*r+rrr�run@s
z	check.runcCs�|jj}g}dD]"}t||�r(t||�s|�|�q|rL|�dd�|��|jrd|js�|�d�n"|j	r||j
s�|�d�n
|�d�dS)z�Ensures that all required elements of meta-data are supplied.

        name, version, URL, (author and author_email) or
        (maintainer and maintainer_email)).

        Warns if any are missing.
        )�name�versionZurlzmissing required meta-data: %sz, zLmissing meta-data: if 'author' supplied, 'author_email' must be supplied toozTmissing meta-data: if 'maintainer' supplied, 'maintainer_email' must be supplied toozimissing meta-data: either (author and author_email) or (maintainer and maintainer_email) must be suppliedN)�distributionr#�hasattr�getattrrr.�joinZauthorZauthor_emailZ
maintainerZmaintainer_email)rr#Zmissing�attrrrrr0Pszcheck.check_metadatacCsX|j��}|�|�D]>}|d�d�}|dkr8|d}nd|d|f}|�|�qdS)z4Checks if the long string fields are reST-compliant.����lineNr)z%s (line %s))r6Zget_long_description�_check_rst_data�getr.)r�dataZwarningr<rrrr2ns

zcheck.check_restructuredtextc
Cs�|jjp
d}t�}tjtfd���}d|_d|_d|_t	||j
|j|j|j
|j|jd�}tj|||d�}|�|d�z|�||�Wn:tk
r�}z|j�dd|d	if�W5d}~XYnX|jS)
z8Returns warnings when the provided data doesn't compile.zsetup.py)Z
components�N)rrrr)rr;z!Could not finish the parsing: %s.�)r6Zscript_namerrZOptionParserZget_default_valuesZ	tab_widthZpep_referencesZrfc_referencesr	rrZwarning_streamrZerror_encodingZerror_encoding_error_handlerr�documentZnote_source�parse�AttributeErrorr
r)rr?�source_path�parserZsettingsZreporterrB�errrr=ys.��zcheck._check_rst_dataN)rr r!�__doc__ZdescriptionZuser_optionsZboolean_optionsr,r-r.r3r0r2r=rrrrr"$s�
r"N)rHZdistutils.corerZdistutils.errorsrZdocutils.utilsrZdocutils.parsers.rstrZdocutilsrr�iorr	r1�	Exceptionr"rrrr�<module>s
__pycache__/build_py.cpython-38.opt-1.pyc000064400000024271150513660060014162 0ustar00U

e5d&C�@szdZddlZddlZddlZddlZddlmZddlTddl	m
Z
mZddlm
Z
Gdd�de�ZGd	d
�d
ee�ZdS)zHdistutils.command.build_py

Implements the Distutils 'build_py' command.�N)�Command)�*)�convert_path�	Mixin2to3)�logc@s�eZdZdZdddddgZddgZd	diZd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd2d'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1S)3�build_pyz5"build" pure Python modules (copy to build directory))z
build-lib=�dzdirectory to "build" (copy) to)�compile�czcompile .py to .pyc)�
no-compileNz!don't compile .py files [default])z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�force�fz2forcibly build everything (ignore file timestamps)r	r
rcCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)�	build_lib�
py_modules�package�package_data�package_dirr	�optimizer
��self�r�2/usr/lib64/python3.8/distutils/command/build_py.py�initialize_options szbuild_py.initialize_optionsc	Cs�|�ddd�|jj|_|jj|_|jj|_i|_|jjr^|jj��D]\}}t|�|j|<qF|��|_	t
|jt�s�zt|j�|_Wn t
tfk
r�td��YnXdS)NZbuild)rr)r
r
zoptimize must be 0, 1, or 2)Zset_undefined_options�distribution�packagesrrr�itemsr�get_data_files�
data_files�
isinstancer�int�
ValueError�AssertionErrorZDistutilsOptionError)r�name�pathrrr�finalize_options*s$�



zbuild_py.finalize_optionscCs:|jr|��|jr$|��|��|�|jdd��dS�Nr)�include_bytecode)r�
build_modulesr�build_packages�build_package_data�byte_compile�get_outputsrrrr�runCszbuild_py.runcs�g}|js|S|jD]h}|�|�}tjj|jg|�d��}d�|rPt|�d��fdd�|�||�D�}|�	||||f�q|S)z?Generate list of '(package,src_dir,build_dir,filenames)' tuples�.r�csg|]}|�d��qS�Nr)�.0�file�Zplenrr�
<listcomp>ssz+build_py.get_data_files.<locals>.<listcomp>)
r�get_package_dir�osr$�joinr�split�len�find_data_files�append)r�datar�src_dir�	build_dir�	filenamesrr3rras



�zbuild_py.get_data_filescsd|j�dg�|j�|g�}g�|D]:}t�tj�t�|�t|���}���fdd�|D��q$�S)z6Return filenames for package's data files in 'src_dir'�cs$g|]}|�krtj�|�r|�qSr)r6r$�isfile)r1�fn��filesrrr4�s�z,build_py.find_data_files.<locals>.<listcomp>)	r�get�globr6r$r7�escaper�extend)rrr=Zglobs�patternZfilelistrrCrr:ys�zbuild_py.find_data_filescCs`d}|jD]P\}}}}|D]>}tj�||�}|�tj�|��|jtj�||�|dd�qq
dS)z$Copy data files into build directoryNF�Z
preserve_mode)rr6r$r7�mkpath�dirname�	copy_file)rZlastdirrr=r>r?�filename�targetrrrr*�s�zbuild_py.build_package_datacCs�|�d�}|js&|r tjj|�SdSn�g}|r�z|jd�|�}Wn*tk
rl|�d|d�|d=Yq*X|�d|�tjj|�Sq*|j�d�}|dk	r�|�d|�|r�tjj|�SdSdS)z�Return the directory, relative to the top of the source
           distribution, where package 'package' should be found
           (at least according to the 'package_dir' option, if any).r.r@r���N)r8rr6r$r7�KeyError�insertrE)rrr$�tailZpdirrrrr5�s(
	zbuild_py.get_package_dircCsj|dkr8tj�|�s td|��tj�|�s8td|��|rftj�|d�}tj�|�rZ|St�d|�dS)Nr@z%package directory '%s' does not existz>supposed package directory '%s' exists, but is not a directoryz__init__.pyz8package init file '%s' not found (or not a regular file))	r6r$�existsZDistutilsFileError�isdirr7rAr�warn)rrr�init_pyrrr�
check_package�s&����zbuild_py.check_packagecCs&tj�|�st�d||�dSdSdS)Nz!file %s (for module %s) not foundFT)r6r$rArrV)r�module�module_filerrr�check_module�szbuild_py.check_modulec	Cs�|�||�t�tj�t�|�d��}g}tj�|jj�}|D]P}tj�|�}||kr�tj�	tj�
|��d}|�|||f�q>|�d|�q>|S)Nz*.pyrzexcluding %s)
rXrFr6r$r7rG�abspathrZscript_name�splitext�basenamer;Zdebug_print)	rrrZmodule_files�modulesZsetup_scriptrZabs_frYrrr�find_package_modules�szbuild_py.find_package_modulesc	Cs�i}g}|jD]�}|�d�}d�|dd��}|d}z||\}}Wn"tk
rh|�|�}d}YnX|s�|�||�}	|df||<|	r�|�|d|	f�tj�||d�}
|�	||
�s�q|�|||
f�q|S)a�Finds individually-specified Python modules, ie. those listed by
        module name in 'self.py_modules'.  Returns a list of tuples (package,
        module_base, filename): 'package' is a tuple of the path through
        package-space to the module; 'module_base' is the bare (no
        packages, no dots) module name, and 'filename' is the path to the
        ".py" file (relative to the distribution root) that implements the
        module.
        r.rrPr/�__init__�.py)
rr8r7rQr5rXr;r6r$r[)rrr_rYr$rZmodule_baser�checkedrWrZrrr�find_modules�s*



zbuild_py.find_modulescCsNg}|jr|�|���|jrJ|jD]$}|�|�}|�||�}|�|�q$|S)a4Compute the list of all modules that will be built, whether
        they are specified one-module-at-a-time ('self.py_modules') or
        by whole packages ('self.packages').  Return a list of tuples
        (package, module, module_file), just like 'find_modules()' and
        'find_package_modules()' do.)rrHrdrr5r`)rr_rr�mrrr�find_all_moduless

zbuild_py.find_all_modulescCsdd�|��D�S)NcSsg|]}|d�qS)rPr)r1rYrrrr4-sz-build_py.get_source_files.<locals>.<listcomp>)rfrrrr�get_source_files,szbuild_py.get_source_filescCs$|gt|�|dg}tjj|�S)Nrb)�listr6r$r7)rr>rrYZoutfile_pathrrr�get_module_outfile/szbuild_py.get_module_outfiler/cCs�|��}g}|D]p\}}}|�d�}|�|j||�}|�|�|r|jr^|�tjj|dd��|j	dkr|�tjj||j	d��q|dd�|j
D�7}|S)Nr.r@)�optimizationrcSs,g|]$\}}}}|D]}tj�||��qqSr)r6r$r7)r1rr=r>r?rNrrrr4Bs
�z(build_py.get_outputs.<locals>.<listcomp>)rfr8rirr;r	�	importlib�util�cache_from_sourcerr)rr'r_ZoutputsrrYrZrNrrrr,3s*


�

�
�zbuild_py.get_outputscCsbt|t�r|�d�}nt|ttf�s,td��|�|j||�}tj	�
|�}|�|�|j||dd�S)Nr.z:'package' must be a string (dot-separated), list, or tuplerrJ)
r�strr8rh�tuple�	TypeErrorrirr6r$rLrKrM)rrYrZrZoutfile�dirrrr�build_moduleJs
�
zbuild_py.build_modulecCs*|��}|D]\}}}|�|||�qdSr0)rdrr)rr_rrYrZrrrr(Yszbuild_py.build_modulescCsD|jD]8}|�|�}|�||�}|D]\}}}|�|||�q$qdSr0)rr5r`rr)rrrr_Zpackage_rYrZrrrr)bs



zbuild_py.build_packagescCs�tjr|�d�dSddlm}|j}|dtjkr>|tj}|jrZ||d|j	||j
d�|jdkr||||j|j	||j
d�dS)Nz%byte-compiling is disabled, skipping.r)r+rP)rr
�prefix�dry_run)�sys�dont_write_bytecoderV�distutils.utilr+rr6�sepr	r
rtr)rrDr+rsrrrr+vs&

�
�zbuild_py.byte_compileN)r/)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optrr%r-rr:r*r5rXr[r`rdrfrgrir,rrr(r)r+rrrrrs8�



'4
	rc@seZdZdd�Zdd�ZdS)�
build_py_2to3cCsLg|_|jr|��|jr*|��|��|�|j�|�|jdd��dSr&)	�
updated_filesrr(rr)r*Zrun_2to3r+r,rrrrr-�szbuild_py_2to3.runcCs,t�||||�}|dr(|j�|d�|S)Nr/r)rrrr}r;)rrYrZr�resrrrrr�szbuild_py_2to3.build_moduleN)ryrzr{r-rrrrrrr|�sr|)�__doc__r6�importlib.utilrkrurFZdistutils.corerZdistutils.errorsrwrrZ	distutilsrrr|rrrr�<module>s}__pycache__/install_headers.cpython-38.opt-2.pyc000064400000003010150513660060015501 0ustar00U

e5d�@s ddlmZGdd�de�ZdS)�)�Commandc@sFeZdZdZddgZdgZdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�install_headerszinstall C/C++ header files)zinstall-dir=�dz$directory to install header files to)�force�fz-force installation (overwrite existing files)rcCsd|_d|_g|_dS)Nr)�install_dirr�outfiles��self�r�9/usr/lib64/python3.8/distutils/command/install_headers.py�initialize_optionssz"install_headers.initialize_optionscCs|�ddd�dS)NZinstall)rr)rr)Zset_undefined_optionsr	rrr�finalize_optionss�z install_headers.finalize_optionscCsH|jj}|sdS|�|j�|D]"}|�||j�\}}|j�|�q dS�N)�distribution�headersZmkpathrZ	copy_filer�append)r
r�header�out�_rrr�run!szinstall_headers.runcCs|jjp
gSr)rrr	rrr�
get_inputs+szinstall_headers.get_inputscCs|jSr)rr	rrr�get_outputs.szinstall_headers.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsr
rrrrrrrrr
s�
rN)Zdistutils.corerrrrrr�<module>s__pycache__/install_data.cpython-38.opt-1.pyc000064400000004363150513660070015013 0ustar00U

e5d�@s<dZddlZddlmZddlmZmZGdd�de�ZdS)z�distutils.command.install_data

Implements the Distutils 'install_data' command, for installing
platform-independent data files.�N)�Command)�change_root�convert_pathc@sHeZdZdZdddgZdgZdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�install_datazinstall data files)zinstall-dir=�dzIbase directory for installing data files (default: installation base dir))zroot=Nz<install everything relative to this alternate root directory)�force�fz-force installation (overwrite existing files)rcCs,d|_g|_d|_d|_|jj|_d|_dS)Nr�)�install_dir�outfiles�rootrZdistribution�
data_files�warn_dir��self�r�6/usr/lib64/python3.8/distutils/command/install_data.py�initialize_optionss
zinstall_data.initialize_optionscCs|�dddd�dS)NZinstall)rr
)rr)rr)Zset_undefined_optionsrrrr�finalize_options#s
�zinstall_data.finalize_optionscCs�|�|j�|jD]�}t|t�rbt|�}|jrB|�d||jf�|�||j�\}}|j	�
|�qt|d�}tj�
|�s�tj�|j|�}n|jr�t|j|�}|�|�|dgkr�|j	�
|�q|dD](}t|�}|�||�\}}|j	�
|�q�qdS)NzMsetup script did not provide a directory for '%s' -- installing right in '%s'rr	)Zmkpathr
r
�
isinstance�strrr�warnZ	copy_filer�append�os�path�isabs�joinrr)rr�out�_�dir�datarrr�run*s,

�
zinstall_data.runcCs
|jpgS�N)r
rrrr�
get_inputsKszinstall_data.get_inputscCs|jSr")rrrrr�get_outputsNszinstall_data.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrr!r#r$rrrrrs�	!r)�__doc__rZdistutils.corerZdistutils.utilrrrrrrr�<module>s__pycache__/upload.cpython-38.opt-2.pyc000064400000011702150513660070013634 0ustar00U

&�.e��@s�ddlZddlZddlZddlZddlmZddlmZmZm	Z	ddl
mZddlm
Z
mZddlmZddlmZddlmZGd	d
�d
e�ZdS)�N)�standard_b64encode)�urlopen�Request�	HTTPError)�urlparse)�DistutilsError�DistutilsOptionError)�
PyPIRCCommand)�spawn)�logc@sJeZdZdZejddgZejdgZdd�Zdd�Zd	d
�Z	dd�Z
d
S)�uploadzupload binary package to PyPI)�sign�szsign files to upload using gpg)z	identity=�izGPG identity used to sign filesr
cCs,t�|�d|_d|_d|_d|_d|_dS)N�rF)r	�initialize_options�username�password�
show_responser
�identity)�self�r�0/usr/lib64/python3.8/distutils/command/upload.pyr s
zupload.initialize_optionscCsrt�|�|jr|jstd��|��}|ikrV|d|_|d|_|d|_|d|_	|jsn|j
jrn|j
j|_dS)Nz.Must use --sign for --identity to have meaningrr�
repository�realm)r	�finalize_optionsrr
rZ_read_pypircrrrr�distribution)rZconfigrrrr(s
�



zupload.finalize_optionscCs:|jjsd}t|��|jjD]\}}}|�|||�qdS)NzHMust create and upload files in one command (e.g. setup.py sdist upload))rZ
dist_filesr�upload_file)r�msg�command�	pyversion�filenamerrr�run:s
z
upload.runc"Cst|j�\}}}}}}	|s"|s"|	r0td|j��|dkrDtd|��|jr|ddd|g}
|jrnd|jg|
dd�<t|
|jd	�t|d
�}z|�	�}W5|��X|j
j}
dd|
��|
�
�tj�|�|f||t�|���d
|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
� �d�}zt�!|���}WnPt"k
�r�}z0d|}|�#|t$j%�ddl&m'}|��s|�W5d}~XYn
X||d<d|d<|j�r�t|dd
��"}tj�|�d|�	�f|d<W5QRX|j(d|j)�*d�}dt+|��,d�}d}d|�*d�}|d}t-�.�}|�/�D]�\}}d|}t0|t1��sP|g}|D]j}t2|�t3k�r�|d|d7}|d}nt4|��*d �}|�5|�|�5|�*d ��|�5d!�|�5|��qT�q.|�5|�|�6�}d"||jf}|�#|t$j%�d#|t4t7|��|d$�}t8|j||d%�}zt9|�}|�:�}|j;} Wnft<k
�rd}z|j=}|j;} W5d}~XYn8t>k
�r�}z|�#t4|�t$j?��W5d}~XYnX|d&k�r�|�#d'|| ft$j%�|j@�r|�A|�}!d(�Bd)|!d)f�}|�#|t$j%�n"d*|| f}|�#|t$j?�tC|��dS)+NzIncompatible url %s)ZhttpZhttpszunsupported schema Zgpgz
--detach-signz-az--local-user�)�dry_run�rbZfile_upload�1z1.0)z:actionZprotocol_version�name�version�contentZfiletyper Z
sha256_digestZmetadata_versionZsummaryZ	home_pageZauthorZauthor_email�license�description�keywords�platformZclassifiersZdownload_urlZprovidesZrequiresZ	obsoletesz#calculating md5 checksum failed: %sr)�
get_fips_modeZ
md5_digestrZcommentz.ascZ
gpg_signature�:�asciizBasic z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s
--s--
z+
Content-Disposition: form-data; name="%s"z; filename="%s"�zutf-8s

zSubmitting %s to %sz multipart/form-data; boundary=%s)zContent-typezContent-lengthZ
Authorization)�data�headers��zServer response (%s): %s�
zK---------------------------------------------------------------------------zUpload failed (%s): %s)Drr�AssertionErrorr
rr
r$�open�close�readrZmetadataZget_nameZget_version�os�path�basename�hashlibZsha256Z	hexdigestZget_descriptionZget_urlZget_contactZget_contact_emailZget_licenceZget_long_descriptionZget_keywordsZ
get_platformsZget_classifiersZget_download_urlZget_providesZget_requiresZ
get_obsoletesZmd5�
ValueErrorZannouncer�INFOZ_hashlibr.rr�encoder�decode�io�BytesIO�items�
isinstance�list�type�tuple�str�write�getvalue�lenrrZgetcoderr�code�OSErrorZERRORrZ_read_pypi_response�joinr)"rrr r!ZschemaZnetlocZurlZparamsZqueryZ	fragmentsZgpg_args�fr)�metar2Zdigest�err.Z	user_passZauth�boundaryZsep_boundaryZend_boundaryZbody�key�value�titler3Zrequest�resultZstatus�reason�textrrrrBs���

�!�




��

�
zupload.upload_fileN)�__name__�
__module__�__qualname__r+r	Zuser_optionsZboolean_optionsrrr"rrrrrrs�r)r:rBr-r=�base64rZurllib.requestrrrZurllib.parserZdistutils.errorsrrZdistutils.corer	Zdistutils.spawnr
Z	distutilsrrrrrr�<module>s__pycache__/bdist_msi.cpython-38.pyc000064400000046251150513660070013374 0ustar00U

e5d߉�@s�dZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZddlZdd
lmZmZmZddlmZmZmZmZGdd
�d
e�ZGdd�de�ZdS)z#
Implements the bdist_msi command.
�N)�Command)�remove_tree)�get_python_version)�
StrictVersion)�DistutilsOptionError)�get_platform)�log)�schema�sequence�text)�	Directory�Feature�Dialog�add_datac@sFeZdZdZdd�Zdd�Zddd	�Zddd�Zddd�Zdd�Z	dS)�PyDialogz�Dialog class with a fixed layout: controls at the top, then a ruler,
    then a list of buttons: back, next, cancel. Optionally a bitmap at the
    left.cOs>tj|f|��|jd}d|d}|�dd||jd�dS)zbDialog(database, name, x, y, w, h, attributes, title, first,
        default, cancel, bitmap=true)�$�iHZ
BottomLinerN)r�__init__�h�line�w)�self�args�kwZrulerZbmwidth�r�3/usr/lib64/python3.8/distutils/command/bdist_msi.pyrs
zPyDialog.__init__c
Cs|�ddddddd|�dS)	z,Set the title text of the dialog at the top.�Title��
�@�<�z{\VerdanaBold10}%sN)r)r�titlerrrr"#s�zPyDialog.title�Back�c
Cs,|r
d}nd}|�|d|jddd|||�S)z�Add a back button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associated�r$���8���
pushbuttonr�rr"�next�name�active�flagsrrr�back*sz
PyDialog.back�Cancelc
Cs,|r
d}nd}|�|d|jddd|||�S)z�Add a cancel button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr%r$i0r'r(r)r*r,rrr�cancel5szPyDialog.cancel�Nextc
Cs,|r
d}nd}|�|d|jddd|||�S)z�Add a Next button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr%r$��r'r(r)r*r,rrrr-@sz
PyDialog.nextc
Cs,|�|t|j|d�|jdddd||�S)z�Add a button with a given title, the tab-next button,
        its name in the Control table, giving its x position; the
        y-position is aligned with the other buttons.

        Return the button, so that events can be associated�r'r(r)r%)r+�intrr)rr.r"r-Zxposrrr�xbuttonKszPyDialog.xbuttonN)r#r$)r2r$)r4r$)
�__name__�
__module__�__qualname__�__doc__rr"r1r3r-r8rrrrrs



rc@s�eZdZdZdddde�fdddd	d
ddd
g
ZddddgZddddddddddddddd d!d"d#d$d%gZd&Zd'd(�Z	d)d*�Z
d+d,�Zd-d.�Zd/d0�Z
d1d2�Zd3d4�Zd5d6�Zd7S)8�	bdist_msiz7create a Microsoft Installer (.msi) binary distribution)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)�no-target-compile�cz/do not compile .py to .pyc on the target system)�no-target-optimize�oz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=�dz-directory to put final built distributions in)�
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distributionr?rArCrFz2.0z2.1z2.2z2.3z2.4z2.5z2.6z2.7z2.8z2.9z3.0z3.1z3.2z3.3z3.4z3.5z3.6z3.7z3.8z3.9�XcCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)Nr)�	bdist_dir�	plat_name�	keep_tempZno_target_compileZno_target_optimize�target_version�dist_dir�
skip_build�install_script�pre_install_script�versions)rrrr�initialize_options}szbdist_msi.initialize_optionscCs�|�dd�|jdkr2|�d�j}tj�|d�|_t�}|jsN|j	�
�rN||_|jr�|jg|_|js�|j	�
�r�|j|kr�t
d|f��nt|j�|_|�ddd�|jr�t
d��|jr�|j	jD]}|jtj�|�kr�q�q�t
d|j��d|_dS)	NZbdist)rMrMZmsizMtarget version can only be %s, or the '--skip-build' option must be specified)rLrL)rIrIz5the pre-install-script feature is not yet implementedz(install_script '%s' not found in scripts)Zset_undefined_optionsrH�get_finalized_command�
bdist_base�os�path�joinrrK�distribution�has_ext_modulesrPrMr�list�all_versionsrOrNZscripts�basename�install_script_key)rrSZ
short_versionZscriptrrr�finalize_options�sH

�������zbdist_msi.finalize_optionscCs�|js|�d�|jddd�}|j|_|j|_d|_|�d�}d|_d|_|j�	�r�|j
}|s~|jsltd��dtj
dd	�}d
|j|f}|�d�}tj�|jd|�|_t�d|j�|��tj�dtj�|jd
��|��tjd=|�|j�|j��}|�|�}tj�|�}tj�|��r0t� |�|jj!}|j"}	|	�sJ|j#}	|	�sTd}	|�$�}
dt%|
�j&}|j��}|j
�r�d|j
|f}nd|}t'�(|t)|t'�*�||	�|_+t'�,|j+t-�d|
fg}
|j.�p�|j/}|�r�|
�0d|f�|j1�r|
�0d|j1f�|
�rt2|j+d|
�|�3�|�4�|�5�|�6�|j+�7�t8|jd��rld|j
�pXd|f}|jj9�0|�|j:�s�t;|j|j<d�dS)N�build�installr$)Zreinit_subcommandsr�install_libz Should have already checked thisz%d.%d�z.%s-%s�libzinstalling to %sZPURELIBZUNKNOWNz%d.%d.%dzPython %s %sz	Python %sZDistVersionZ
ARPCONTACTZARPURLINFOABOUT�Property�
dist_filesr=�any)�dry_run)=rMZrun_commandZreinitialize_commandrH�prefixZwarn_dir�compile�optimizerWrXrK�AssertionError�sys�version_inforIrRrTrUrVZ
build_baseZ	build_libr�infoZensure_finalized�insert�runZmkpathrL�get_fullname�get_installer_filename�abspath�exists�unlink�metadata�authorZ
maintainerZget_versionr�version�msilibZ
init_databaser	Zgen_uuid�dbZ
add_tablesr
Zauthor_emailZmaintainer_email�appendZurlr�add_find_python�	add_files�add_scripts�add_ui�Commit�hasattrrdrJrrf)rr_r`rKZplat_specifierr^�fullname�installer_namerurvrwZsversionZproduct_nameZpropsZemail�tuprrrro�s�




�



�

z
bdist_msi.runc
Cs|j}t�d�}tj�|j�}t||d|dd�}t|ddddddd�}||d	fg}|j	|j
gD]t}d|}d|}	}
d}||j
kr�d
}d}
nd|}d}
t||	||d|
|d�}t||||||
�}|�|||f�q`|��i}|D�]\}}}|g}|�r�|�
�}t�|j�D]�}tj�|j|�}tj�|��rld
|�|�|f}||}
t|||||
|�}|�|�n�|j�s�|�|j|d�||k�r�|�|�}||<||jk�r�|j�r�td|��d||_n*||}t|jd|||j|d|jfg��qq�|��q�|�|�dS)NZ	distfiles�	TARGETDIRZ	SourceDir�PythonZ
Everythingrr$)Z	directory�zPython from another locationrazPython %s from registryz%s|%szMultiple files with name %sz[#%s]Z
DuplicateFile)ryrxZCABrTrUrrrHrr
rP�
other_versionrzr�pop�listdirZabsoluterV�isdirZ
make_shortZ	componentZstart_componentZlogicalZadd_filerNr\rrZcommit)rryZcabZrootdir�root�f�itemsrw�targetr.�defaultZdescr"�level�dir�seenZfeatureZtodo�fileZafileZshortZnewdir�keyrrrr|
sf

�

��

zbdist_msi.add_filescCs�d}|jD�]v}d|}d|}d|}d|}d|}d|}d|}	d	|}
d
|}d|}tjrld}
nd
}
t|jd|d
|d|
f|d|d|
fg�t|jd||f||fg�t|jd|d|d|df|	d|d|df|
d|d|dfg�t|jd|||f|	||df|
d|d
fg�t|jd|||f|	||df|
d|d
fg�t|jdd|dd|fg�|d7}|dks
t�q
dS)asAdds code to the installer to compute the location of Python.

        Properties PYTHON.MACHINE.X.Y and PYTHON.USER.X.Y will be set from the
        registry for each version of Python.

        Properties TARGETDIRX.Y will be set from PYTHON.USER.X.Y if defined,
        else from PYTHON.MACHINE.X.Y.

        Properties PYTHONX.Y will be set to TARGETDIRX.Y\python.exei�z)SOFTWARE\Python\PythonCore\%s\InstallPathzpython.machine.zpython.user.zPYTHON.MACHINE.zPYTHON.USER.ZPythonFromMachineZPythonFromUserZ	PythonExer��PYTHON�raZ
RegLocatorNr$Z	AppSearch�CustomActioni3�[�]z]\python.exe�InstallExecuteSequence�InstallUISequenceZ	Conditionr�rz
NOT TARGETDIR�i�)rPrxZWin64rryrj)r�start�verZinstall_pathZmachine_regZuser_regZmachine_propZ	user_propZmachine_actionZuser_actionZ
exe_actionZtarget_dir_prop�exe_propZTyperrrr{Cs`�����������zbdist_msi.add_find_pythonc
Cs|jrjd}|j|jgD]P}d|}d|}t|jd|d||jfg�t|jd|d||fg�|d7}q|jr�tj�	|j
d	�}t|d
��4}|�d�t|j��}|�|�
��W5QRXW5QRXt|jdd
t�|�fg�t|jddg�t|jddg�dS)Ni�zinstall_script.r�r��2r�z&Python%s=3r$zpreinstall.batrzrem ="""
%1 %0
exit
"""
�Binary�
PreInstall)r�rar�N)r�z
NOT Installedi�)rNrPr�rryr\rOrTrUrVrH�open�write�readrxr�)rr�r�Zinstall_actionr�Zscriptfnr�Zfinrrrr}ys6��
	
"���zbdist_msi.add_scriptscCs�
|j}d}}d}d}d}d}d}d}	t|dd	d
ddd
dg�t|dddddg�t|ddddddg�t|dtj�t|dtj�t|d||||||ddd�}
|
�d�|
jddd d!�|
jd"d#d d!�|
�d$d%d&d'd(d)d*�|
�d+d%d,d'd-d)d.�|
j	dd"dd/�}|�
d0d1�t|d2||||||ddd�}|�d3�|jddd d!�|jd"d#d d!�|�d$d%d&d'd(d)d4�|�d+d%d,d'd-d)d.�|j	dd"dd/�}|�
d0d1�t|d5||||||ddd�}
|
�d6�|
jddd d!�|
jd"d#d d!�|
�d7d%d8d'd-d)d.�|
j	dd"dd/�}|�
d0d9�t|d:||||d;|d<d<d<d=d>�}|�d?d%d@dAd%d)dB�|�d7d-dCdDd-d)dE�|�dFd-dGdHdddI�|�dJdKd-dLdHdMdNdOddd�|jd1dPd1d/�}|�
d0d1�|j	dPd<dPd/�}|�
d0dP�|jd<d1d<d/�}|�
d0d<�t|dQddRdHdSdT|dUdd�}|�dUddVdDdWddX�|�
dYdZd[d\d]dd^d��
d0d_�|�
d`dad[d\d]ddbd��
d0dc�|�
ddd d[d\d]dded��
d0df�|�
dgdhd[d\d]dd"d��
d0di�|�
djd\d[d\d]ddPd��
d0dk�|�
dldmd[d\d]ddnd��
d0do�|�
dpdqd[d\d]dd<d��
d0dr�t|dsddRdtdud|d^d^d^�}|�dFdWd%dvdwddx�|�
dbd[dydzd{ddbd^�}|�
d0d1�|�
d^d|dydzd{dd^db�}|�
d0d9�t|d}ddRdtdu||d9d9d9�}|�dFdWd%dvdwdd~�|�
d9ddydzd{dd9d�}|�
d0d1�t|d�||||||d"d"d"�}|�d7d%d&d'd�d)d��|�d��|�dd%d�d'd-d)d��}|�ddF�|�d�d%d�d'dwd)d�}|�d�dF�|jd#dd d!�|j	d�dd d!�|�d"d�}|�
d�ds�t|d�||||||d�d�d"�}|�d��|�d�d%dwdd-dd�|j���|jddd d!�|�	d�d"�}d}|j
d�d�|d��|j|jgD](}|d7}|j
d�d�|d�||d���q
|j
d�d}|dd��|j
d0d9|d�d��|�d"d��}|�
d�ds�|�d�d�d%d�ddZdd�dd�d�}|�
d�d��|j}d�|}d�|}|�d�d%dAdd%dd��}|�d�|�|�d�|�|�d�|�|�d�|�|�d�d�d%d�dd�dd�|dd�d�}|�d�|�|�d�|�|�d�|�|�d�|�t|d�||||||d�d�d�d=d>�}|�d?d%d@dAd%d)d��|�d7d-d-dDd-d)d��|�dFd-d�dHd�dd��|�d�d�d-d�dHd�d�dd�dd�|�d�dndd���
d0d9�t|d�||||||d�d�d"�}|�d��|�d�d%d�dtddd�dXd��	}|�d�d d�d�d-d��|�d�d d�d�d-d��|jd#dd d!�|�	d�d"�}|�
d�d�d�d�|j
d0d9d�d��|�d"d��}|�
d�ds�t|d�||||||d"d"d"d=d>�}|�d?d-d%dAd%d)d��|�dFd�d�ddwddġ|�d�d�d�d�d-ddơ|�dd&d�|d&d-dd��}|�ddF�|�d�d�d�dZddRd�dd�dd�}|�d�dˡ|jdd�d=d!�|j	d�d"d=d!�|�d"d#��
d�ds�t|d�||||||d�d�d"�}|�d͡|�d�d%d�dHdhddС|�d�d%d�dHd�dd�dXd��	}|�d�d d�dAd{d֡|�d�d d�dAd{d١|jddd=d!�|�	dd"�}|�
d�d�d�d��|�
d�d�d�d@�|�
d�d�d�dN�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d0d9d�d-�|�d"dѡ�
d�ds�dS)�Nr�iri,z[ProductName] Setupr%r$� rc)Z
DefaultUIFont�DlgFont8)ZErrorDialog�ErrorDlg)Z	Progress1ZInstall)Z	Progress2Zinstalls)�MaintenanceForm_Action�Repair)�
WhichUsers�ALLZ	TextStyle)r��Tahoma�	Nr)ZDlgFontBold8r��Nr$)Z
VerdanaBold10�VerdanarNr$)ZVerdanaRed9r�r��rr�)�
PrepareDlgz(Not Privileged or Windows9x or Installed�)�
WhichUsersDlgz.Privileged and not Windows9x and not Installed�)�SelectFeaturesDlgz
Not Installedi�)�MaintenanceTypeDlgz,Installed AND NOT RESUME AND NOT Preselectedi�)�ProgressDlgNi�
ActionText�UITextZ
FatalErrorZFinishz)[ProductName] Installer ended prematurelyz< Backr)r/r2r#ZDescription1r�Fr�Pr!z�[ProductName] setup ended prematurely because of an error.  Your system has not been modified.  To install this program at a later time, please run the installation again.ZDescription2��z.Click the Finish button to exit the Installer.)r.Z	EndDialogZExitZUserExitz'[ProductName] Installer was interruptedz�[ProductName] setup was interrupted.  Your system has not been modified.  To install this program at a later time, please run the installation again.Z
ExitDialogz&Completing the [ProductName] InstallerZDescription��ZReturnZ
FilesInUse�ZRetryF)Zbitmapr���z{\DlgFontBold8}Files in Use�iz8Some files that need to be updated are currently in use.ZText�7iJz�The following applications are using files that need to be updated by this setup. Close these applications and then click Retry to continue the installation or Cancel to exit it.ZListZListBox�k��ZFileInUseProcess�Ignorer�r�eiZ	ErrorTextr��0r��N�x�H�Q�ZNoZErrorNo�Y��ZYesZErrorYes�AZAbortZ
ErrorAbort�C�*ZErrorCancel�IZErrorIgnore�O�ZOkZErrorOk�R��Z
ErrorRetryZ	CancelDlgi�U���z;Are you sure you want to cancel [ProductName] installation?�9r(r)�ZWaitForCostingDlgzRPlease wait while the installer finishes determining your disk space requirements.�fr��(zOPlease wait while the Installer prepares to guide you through the installation.z&Welcome to the [ProductName] Installer�nzPondering...Z
ActionData�r4ZSpawnDialogr�zSelect Python InstallationsZHintz9Select the Python locations where %s should be installed.zNext >z[TARGETDIR]z[SourceDir])Zorderingz
[TARGETDIR%s]z FEATURE_SELECTED AND &Python%s=3ZSpawnWaitDialograZFeaturesZ
SelectionTreer ZFEATUREZPathEditz[FEATURE_SELECTED]�1z!FEATURE_SELECTED AND &Python%s<>3ZOtherz$Provide an alternate Python locationZEnableZShowZDisableZHide���r�ZDiskCostDlgZOKz&{\DlgFontBold8}Disk Space RequirementszFThe disk space required for the installation of the selected features.�5aThe highlighted volumes (if any) do not have enough disk space available for the currently selected features.  You can either remove some files from the highlighted volumes, or choose to install less features onto local drive(s), or select different destination drive(s).Z
VolumeListZVolumeCostList�d�iz{120}{70}{70}{70}{70}g�?r�ZAdminInstallzGSelect whether to install [ProductName] for all users of this computer.r�r��zInstall for all usersZJUSTME�zInstall just for mez
[ALLUSERS]zWhichUsers="ALL"r�z({\DlgFontBold8}[Progress1] [ProductName]�#�AzYPlease wait while the Installer [Progress2] [ProductName]. This may take several minutes.ZStatusLabelzStatus:ZProgressBariz
Progress doneZSetProgressZProgressr�z)Welcome to the [ProductName] Setup WizardZBodyText�?z:Select whether you want to repair or remove [ProductName].ZRepairRadioGroup�lr�r�r�z&Repair [ProductName]ZRemoverzRe&move [ProductName]z[REINSTALL]zMaintenanceForm_Action="Repair"z[Progress1]Z	Repairingz[Progress2]ZrepairsZ	Reinstallr�z[REMOVE]zMaintenanceForm_Action="Remove"�ZRemoving�Zremoves�
�z MaintenanceForm_Action<>"Change")ryrrr�r�rr"r1r3r-ZeventZcontrolrr+�mappingrWrprPr�Z	conditionr8Z
radiogroup�add)rry�x�yrrr"ZmodalZmodelessZtrack_disk_spaceZfatalrBZ	user_exitZexit_dialogZinuse�errorr3ZcostingZprepZseldlg�orderrwr�Zinstall_other_condZdont_install_other_condZcostZ
whichusers�gZprogressZmaintrrrr~�sv��
��	��
�
���
���
�������       ������
�
���
��������
�
������
��zbdist_msi.add_uicCs<|jrd||j|jf}nd||jf}tj�|j|�}|S)Nz%s.%s-py%s.msiz	%s.%s.msi)rKrIrTrUrVrL)rr�Z	base_namer�rrrrq�s�z bdist_msi.get_installer_filenameN)r9r:r;ZdescriptionrZuser_optionsZboolean_optionsrZr�rQr]ror|r{r}r~rqrrrrr=Ss^����
�
([66&@r=)r<rkrTZdistutils.corerZdistutils.dir_utilrZdistutils.sysconfigrZdistutils.versionrZdistutils.errorsrZdistutils.utilrZ	distutilsrrxr	r
rrr
rrrr=rrrr�<module>s>__pycache__/install_lib.cpython-38.opt-2.pyc000064400000010666150513660070014654 0ustar00U

e5d� �@sHddlZddlZddlZddlmZddlmZdZGdd�de�Z	dS)�N)�Command)�DistutilsOptionErrorz.pyc@s�eZdZdZdddddddgZd	d
dgZdd
iZd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!S)"�install_libz7install all Python modules (extensions and pure Python))zinstall-dir=�dzdirectory to install to)z
build-dir=�bz'build directory (where to install from))�force�fz-force installation (overwrite existing files))�compile�czcompile .py to .pyc [default])�
no-compileNzdon't compile .py files)z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�
skip-buildNzskip the build stepsrr	r
rcCs(d|_d|_d|_d|_d|_d|_dS)Nr)�install_dir�	build_dirrr	�optimize�
skip_build��self�r�5/usr/lib64/python3.8/distutils/command/install_lib.py�initialize_options3szinstall_lib.initialize_optionsc	Cs�|�ddddddd�|jdkr&d|_|jdkr6d	|_t|jt�s�zt|j�|_|jd
kr^t�Wn ttfk
r�td��YnXdS)N�install)�	build_libr)rr)rr)r	r	)rr)rrTF)r��zoptimize must be 0, 1, or 2)Zset_undefined_optionsr	r�
isinstance�int�AssertionError�
ValueErrorrrrrr�finalize_options<s&�	


zinstall_lib.finalize_optionscCs0|��|��}|dk	r,|j��r,|�|�dS�N)�buildr�distribution�has_pure_modules�byte_compile�rZoutfilesrrr�runVszinstall_lib.runcCs2|js.|j��r|�d�|j��r.|�d�dS�N�build_py�	build_ext)rr"r#Zrun_command�has_ext_modulesrrrrr!fs



zinstall_lib.buildcCs8tj�|j�r |�|j|j�}n|�d|j�dS|S)Nz3'%s' does not exist -- no Python modules to install)�os�path�isdirrZ	copy_treer�warnr%rrrrms�zinstall_lib.installcCsrtjr|�d�dSddlm}|�d�j}|jrH||d|j||j	d�|j
dkrn|||j
|j||j|j	d�dS)Nz%byte-compiling is disabled, skipping.r)r$r)rr�prefix�dry_run)rrr/�verboser0)�sys�dont_write_bytecoder.Zdistutils.utilr$�get_finalized_command�rootr	rr0rr1)r�filesr$Zinstall_rootrrrr$vs$
�
�zinstall_lib.byte_compilec
	Csd|sgS|�|�}|��}t||�}t|�ttj�}g}|D] }	|�tj�||	|d���q>|Sr )	r4�get_outputs�getattr�lenr+�sep�appendr,�join)
rZhas_anyZ	build_cmdZ
cmd_optionZ
output_dirZbuild_filesr�
prefix_lenZoutputs�filerrr�_mutate_outputs�s

zinstall_lib._mutate_outputscCsrg}|D]d}tj�tj�|��d}|tkr.q|jrJ|�tjj	|dd��|j
dkr|�tjj	||j
d��q|S)Nr�)�optimizationr)r+r,�splitext�normcase�PYTHON_SOURCE_EXTENSIONr	r;�	importlib�util�cache_from_sourcer)rZpy_filenamesZbytecode_filesZpy_fileZextrrr�_bytecode_filenames�s 
�

�
zinstall_lib._bytecode_filenamescCsR|�|j��dd|j�}|jr*|�|�}ng}|�|j��dd|j�}|||S)Nr(rr))r?r"r#rr	rHr*)rZpure_outputsZbytecode_outputsZext_outputsrrrr7�s ����zinstall_lib.get_outputscCsLg}|j��r&|�d�}|�|���|j��rH|�d�}|�|���|Sr')r"r#r4�extendr7r*)rZinputsr(r)rrr�
get_inputs�s



zinstall_lib.get_inputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optrrr&r!rr$r?rHr7rJrrrrrs*�
		r)
r+�importlib.utilrEr2Zdistutils.corerZdistutils.errorsrrDrrrrr�<module>s__pycache__/__init__.cpython-38.pyc000064400000001041150513660070013142 0ustar00U

e5d�@s2dZddddddddd	d
ddd
ddddddgZdS)z\distutils.command

Package containing implementation of all the standard Distutils
commands.ZbuildZbuild_pyZ	build_extZ
build_clibZ
build_scriptsZcleanZinstallZinstall_libZinstall_headersZinstall_scriptsZinstall_dataZsdist�registerZbdistZ
bdist_dumbZ	bdist_rpmZ
bdist_wininstZcheckZuploadN)�__doc__�__all__�rr�2/usr/lib64/python3.8/distutils/command/__init__.py�<module>s(�install_headers.py000064400000002422150513660070010262 0ustar00"""distutils.command.install_headers

Implements the Distutils 'install_headers' command, to install C/C++ header
files to the Python include directory."""

from distutils.core import Command


# XXX force is never used
class install_headers(Command):

    description = "install C/C++ header files"

    user_options = [('install-dir=', 'd',
                     "directory to install header files to"),
                    ('force', 'f',
                     "force installation (overwrite existing files)"),
                   ]

    boolean_options = ['force']

    def initialize_options(self):
        self.install_dir = None
        self.force = 0
        self.outfiles = []

    def finalize_options(self):
        self.set_undefined_options('install',
                                   ('install_headers', 'install_dir'),
                                   ('force', 'force'))


    def run(self):
        headers = self.distribution.headers
        if not headers:
            return

        self.mkpath(self.install_dir)
        for header in headers:
            (out, _) = self.copy_file(header, self.install_dir)
            self.outfiles.append(out)

    def get_inputs(self):
        return self.distribution.headers or []

    def get_outputs(self):
        return self.outfiles
config.py000064400000031475150513660070006400 0ustar00"""distutils.command.config

Implements the Distutils 'config' command, a (mostly) empty command class
that exists mainly to be sub-classed by specific module distributions and
applications.  The idea is that while every "config" command is different,
at least they're all named the same, and users always see "config" in the
list of standard commands.  Also, this is a good place to put common
configure-like tasks: "try to compile this C code", or "figure out where
this header file lives".
"""

import os, re

from distutils.core import Command
from distutils.errors import DistutilsExecError
from distutils.sysconfig import customize_compiler
from distutils import log

LANG_EXT = {"c": ".c", "c++": ".cxx"}

class config(Command):

    description = "prepare to build"

    user_options = [
        ('compiler=', None,
         "specify the compiler type"),
        ('cc=', None,
         "specify the compiler executable"),
        ('include-dirs=', 'I',
         "list of directories to search for header files"),
        ('define=', 'D',
         "C preprocessor macros to define"),
        ('undef=', 'U',
         "C preprocessor macros to undefine"),
        ('libraries=', 'l',
         "external C libraries to link with"),
        ('library-dirs=', 'L',
         "directories to search for external C libraries"),

        ('noisy', None,
         "show every action (compile, link, run, ...) taken"),
        ('dump-source', None,
         "dump generated source files before attempting to compile them"),
        ]


    # The three standard command methods: since the "config" command
    # does nothing by default, these are empty.

    def initialize_options(self):
        self.compiler = None
        self.cc = None
        self.include_dirs = None
        self.libraries = None
        self.library_dirs = None

        # maximal output for now
        self.noisy = 1
        self.dump_source = 1

        # list of temporary files generated along-the-way that we have
        # to clean at some point
        self.temp_files = []

    def finalize_options(self):
        if self.include_dirs is None:
            self.include_dirs = self.distribution.include_dirs or []
        elif isinstance(self.include_dirs, str):
            self.include_dirs = self.include_dirs.split(os.pathsep)

        if self.libraries is None:
            self.libraries = []
        elif isinstance(self.libraries, str):
            self.libraries = [self.libraries]

        if self.library_dirs is None:
            self.library_dirs = []
        elif isinstance(self.library_dirs, str):
            self.library_dirs = self.library_dirs.split(os.pathsep)

    def run(self):
        pass

    # Utility methods for actual "config" commands.  The interfaces are
    # loosely based on Autoconf macros of similar names.  Sub-classes
    # may use these freely.

    def _check_compiler(self):
        """Check that 'self.compiler' really is a CCompiler object;
        if not, make it one.
        """
        # We do this late, and only on-demand, because this is an expensive
        # import.
        from distutils.ccompiler import CCompiler, new_compiler
        if not isinstance(self.compiler, CCompiler):
            self.compiler = new_compiler(compiler=self.compiler,
                                         dry_run=self.dry_run, force=1)
            customize_compiler(self.compiler)
            if self.include_dirs:
                self.compiler.set_include_dirs(self.include_dirs)
            if self.libraries:
                self.compiler.set_libraries(self.libraries)
            if self.library_dirs:
                self.compiler.set_library_dirs(self.library_dirs)

    def _gen_temp_sourcefile(self, body, headers, lang):
        filename = "_configtest" + LANG_EXT[lang]
        with open(filename, "w") as file:
            if headers:
                for header in headers:
                    file.write("#include <%s>\n" % header)
                file.write("\n")
            file.write(body)
            if body[-1] != "\n":
                file.write("\n")
        return filename

    def _preprocess(self, body, headers, include_dirs, lang):
        src = self._gen_temp_sourcefile(body, headers, lang)
        out = "_configtest.i"
        self.temp_files.extend([src, out])
        self.compiler.preprocess(src, out, include_dirs=include_dirs)
        return (src, out)

    def _compile(self, body, headers, include_dirs, lang):
        src = self._gen_temp_sourcefile(body, headers, lang)
        if self.dump_source:
            dump_file(src, "compiling '%s':" % src)
        (obj,) = self.compiler.object_filenames([src])
        self.temp_files.extend([src, obj])
        self.compiler.compile([src], include_dirs=include_dirs)
        return (src, obj)

    def _link(self, body, headers, include_dirs, libraries, library_dirs,
              lang):
        (src, obj) = self._compile(body, headers, include_dirs, lang)
        prog = os.path.splitext(os.path.basename(src))[0]
        self.compiler.link_executable([obj], prog,
                                      libraries=libraries,
                                      library_dirs=library_dirs,
                                      target_lang=lang)

        if self.compiler.exe_extension is not None:
            prog = prog + self.compiler.exe_extension
        self.temp_files.append(prog)

        return (src, obj, prog)

    def _clean(self, *filenames):
        if not filenames:
            filenames = self.temp_files
            self.temp_files = []
        log.info("removing: %s", ' '.join(filenames))
        for filename in filenames:
            try:
                os.remove(filename)
            except OSError:
                pass


    # XXX these ignore the dry-run flag: what to do, what to do? even if
    # you want a dry-run build, you still need some sort of configuration
    # info.  My inclination is to make it up to the real config command to
    # consult 'dry_run', and assume a default (minimal) configuration if
    # true.  The problem with trying to do it here is that you'd have to
    # return either true or false from all the 'try' methods, neither of
    # which is correct.

    # XXX need access to the header search path and maybe default macros.

    def try_cpp(self, body=None, headers=None, include_dirs=None, lang="c"):
        """Construct a source file from 'body' (a string containing lines
        of C/C++ code) and 'headers' (a list of header files to include)
        and run it through the preprocessor.  Return true if the
        preprocessor succeeded, false if there were any errors.
        ('body' probably isn't of much use, but what the heck.)
        """
        from distutils.ccompiler import CompileError
        self._check_compiler()
        ok = True
        try:
            self._preprocess(body, headers, include_dirs, lang)
        except CompileError:
            ok = False

        self._clean()
        return ok

    def search_cpp(self, pattern, body=None, headers=None, include_dirs=None,
                   lang="c"):
        """Construct a source file (just like 'try_cpp()'), run it through
        the preprocessor, and return true if any line of the output matches
        'pattern'.  'pattern' should either be a compiled regex object or a
        string containing a regex.  If both 'body' and 'headers' are None,
        preprocesses an empty file -- which can be useful to determine the
        symbols the preprocessor and compiler set by default.
        """
        self._check_compiler()
        src, out = self._preprocess(body, headers, include_dirs, lang)

        if isinstance(pattern, str):
            pattern = re.compile(pattern)

        with open(out) as file:
            match = False
            while True:
                line = file.readline()
                if line == '':
                    break
                if pattern.search(line):
                    match = True
                    break

        self._clean()
        return match

    def try_compile(self, body, headers=None, include_dirs=None, lang="c"):
        """Try to compile a source file built from 'body' and 'headers'.
        Return true on success, false otherwise.
        """
        from distutils.ccompiler import CompileError
        self._check_compiler()
        try:
            self._compile(body, headers, include_dirs, lang)
            ok = True
        except CompileError:
            ok = False

        log.info(ok and "success!" or "failure.")
        self._clean()
        return ok

    def try_link(self, body, headers=None, include_dirs=None, libraries=None,
                 library_dirs=None, lang="c"):
        """Try to compile and link a source file, built from 'body' and
        'headers', to executable form.  Return true on success, false
        otherwise.
        """
        from distutils.ccompiler import CompileError, LinkError
        self._check_compiler()
        try:
            self._link(body, headers, include_dirs,
                       libraries, library_dirs, lang)
            ok = True
        except (CompileError, LinkError):
            ok = False

        log.info(ok and "success!" or "failure.")
        self._clean()
        return ok

    def try_run(self, body, headers=None, include_dirs=None, libraries=None,
                library_dirs=None, lang="c"):
        """Try to compile, link to an executable, and run a program
        built from 'body' and 'headers'.  Return true on success, false
        otherwise.
        """
        from distutils.ccompiler import CompileError, LinkError
        self._check_compiler()
        try:
            src, obj, exe = self._link(body, headers, include_dirs,
                                       libraries, library_dirs, lang)
            self.spawn([exe])
            ok = True
        except (CompileError, LinkError, DistutilsExecError):
            ok = False

        log.info(ok and "success!" or "failure.")
        self._clean()
        return ok


    # -- High-level methods --------------------------------------------
    # (these are the ones that are actually likely to be useful
    # when implementing a real-world config command!)

    def check_func(self, func, headers=None, include_dirs=None,
                   libraries=None, library_dirs=None, decl=0, call=0):
        """Determine if function 'func' is available by constructing a
        source file that refers to 'func', and compiles and links it.
        If everything succeeds, returns true; otherwise returns false.

        The constructed source file starts out by including the header
        files listed in 'headers'.  If 'decl' is true, it then declares
        'func' (as "int func()"); you probably shouldn't supply 'headers'
        and set 'decl' true in the same call, or you might get errors about
        a conflicting declarations for 'func'.  Finally, the constructed
        'main()' function either references 'func' or (if 'call' is true)
        calls it.  'libraries' and 'library_dirs' are used when
        linking.
        """
        self._check_compiler()
        body = []
        if decl:
            body.append("int %s ();" % func)
        body.append("int main () {")
        if call:
            body.append("  %s();" % func)
        else:
            body.append("  %s;" % func)
        body.append("}")
        body = "\n".join(body) + "\n"

        return self.try_link(body, headers, include_dirs,
                             libraries, library_dirs)

    def check_lib(self, library, library_dirs=None, headers=None,
                  include_dirs=None, other_libraries=[]):
        """Determine if 'library' is available to be linked against,
        without actually checking that any particular symbols are provided
        by it.  'headers' will be used in constructing the source file to
        be compiled, but the only effect of this is to check if all the
        header files listed are available.  Any libraries listed in
        'other_libraries' will be included in the link, in case 'library'
        has symbols that depend on other libraries.
        """
        self._check_compiler()
        return self.try_link("int main (void) { }", headers, include_dirs,
                             [library] + other_libraries, library_dirs)

    def check_header(self, header, include_dirs=None, library_dirs=None,
                     lang="c"):
        """Determine if the system header file named by 'header_file'
        exists and can be found by the preprocessor; return true if so,
        false otherwise.
        """
        return self.try_cpp(body="/* No body */", headers=[header],
                            include_dirs=include_dirs)

def dump_file(filename, head=None):
    """Dumps a file content into log.info.

    If head is not None, will be dumped before the file content.
    """
    if head is None:
        log.info('%s', filename)
    else:
        log.info(head)
    file = open(filename)
    try:
        log.info(file.read())
    finally:
        file.close()
sdist.py000064400000045075150513660070006262 0ustar00"""distutils.command.sdist

Implements the Distutils 'sdist' command (create a source distribution)."""

import os
import sys
from glob import glob
from warnings import warn

from distutils.core import Command
from distutils import dir_util
from distutils import file_util
from distutils import archive_util
from distutils.text_file import TextFile
from distutils.filelist import FileList
from distutils import log
from distutils.util import convert_path
from distutils.errors import DistutilsTemplateError, DistutilsOptionError


def show_formats():
    """Print all possible values for the 'formats' option (used by
    the "--help-formats" command-line option).
    """
    from distutils.fancy_getopt import FancyGetopt
    from distutils.archive_util import ARCHIVE_FORMATS
    formats = []
    for format in ARCHIVE_FORMATS.keys():
        formats.append(("formats=" + format, None,
                        ARCHIVE_FORMATS[format][2]))
    formats.sort()
    FancyGetopt(formats).print_help(
        "List of available source distribution formats:")


class sdist(Command):

    description = "create a source distribution (tarball, zip file, etc.)"

    def checking_metadata(self):
        """Callable used for the check sub-command.

        Placed here so user_options can view it"""
        return self.metadata_check

    user_options = [
        ('template=', 't',
         "name of manifest template file [default: MANIFEST.in]"),
        ('manifest=', 'm',
         "name of manifest file [default: MANIFEST]"),
        ('use-defaults', None,
         "include the default file set in the manifest "
         "[default; disable with --no-defaults]"),
        ('no-defaults', None,
         "don't include the default file set"),
        ('prune', None,
         "specifically exclude files/directories that should not be "
         "distributed (build tree, RCS/CVS dirs, etc.) "
         "[default; disable with --no-prune]"),
        ('no-prune', None,
         "don't automatically exclude anything"),
        ('manifest-only', 'o',
         "just regenerate the manifest and then stop "
         "(implies --force-manifest)"),
        ('force-manifest', 'f',
         "forcibly regenerate the manifest and carry on as usual. "
         "Deprecated: now the manifest is always regenerated."),
        ('formats=', None,
         "formats for source distribution (comma-separated list)"),
        ('keep-temp', 'k',
         "keep the distribution tree around after creating " +
         "archive file(s)"),
        ('dist-dir=', 'd',
         "directory to put the source distribution archive(s) in "
         "[default: dist]"),
        ('metadata-check', None,
         "Ensure that all required elements of meta-data "
         "are supplied. Warn if any missing. [default]"),
        ('owner=', 'u',
         "Owner name used when creating a tar file [default: current user]"),
        ('group=', 'g',
         "Group name used when creating a tar file [default: current group]"),
        ]

    boolean_options = ['use-defaults', 'prune',
                       'manifest-only', 'force-manifest',
                       'keep-temp', 'metadata-check']

    help_options = [
        ('help-formats', None,
         "list available distribution formats", show_formats),
        ]

    negative_opt = {'no-defaults': 'use-defaults',
                    'no-prune': 'prune' }

    sub_commands = [('check', checking_metadata)]

    READMES = ('README', 'README.txt', 'README.rst')

    def initialize_options(self):
        # 'template' and 'manifest' are, respectively, the names of
        # the manifest template and manifest file.
        self.template = None
        self.manifest = None

        # 'use_defaults': if true, we will include the default file set
        # in the manifest
        self.use_defaults = 1
        self.prune = 1

        self.manifest_only = 0
        self.force_manifest = 0

        self.formats = ['gztar']
        self.keep_temp = 0
        self.dist_dir = None

        self.archive_files = None
        self.metadata_check = 1
        self.owner = None
        self.group = None

    def finalize_options(self):
        if self.manifest is None:
            self.manifest = "MANIFEST"
        if self.template is None:
            self.template = "MANIFEST.in"

        self.ensure_string_list('formats')

        bad_format = archive_util.check_archive_formats(self.formats)
        if bad_format:
            raise DistutilsOptionError(
                  "unknown archive format '%s'" % bad_format)

        if self.dist_dir is None:
            self.dist_dir = "dist"

    def run(self):
        # 'filelist' contains the list of files that will make up the
        # manifest
        self.filelist = FileList()

        # Run sub commands
        for cmd_name in self.get_sub_commands():
            self.run_command(cmd_name)

        # Do whatever it takes to get the list of files to process
        # (process the manifest template, read an existing manifest,
        # whatever).  File list is accumulated in 'self.filelist'.
        self.get_file_list()

        # If user just wanted us to regenerate the manifest, stop now.
        if self.manifest_only:
            return

        # Otherwise, go ahead and create the source distribution tarball,
        # or zipfile, or whatever.
        self.make_distribution()

    def check_metadata(self):
        """Deprecated API."""
        warn("distutils.command.sdist.check_metadata is deprecated, \
              use the check command instead", PendingDeprecationWarning)
        check = self.distribution.get_command_obj('check')
        check.ensure_finalized()
        check.run()

    def get_file_list(self):
        """Figure out the list of files to include in the source
        distribution, and put it in 'self.filelist'.  This might involve
        reading the manifest template (and writing the manifest), or just
        reading the manifest, or just using the default file set -- it all
        depends on the user's options.
        """
        # new behavior when using a template:
        # the file list is recalculated every time because
        # even if MANIFEST.in or setup.py are not changed
        # the user might have added some files in the tree that
        # need to be included.
        #
        #  This makes --force the default and only behavior with templates.
        template_exists = os.path.isfile(self.template)
        if not template_exists and self._manifest_is_not_generated():
            self.read_manifest()
            self.filelist.sort()
            self.filelist.remove_duplicates()
            return

        if not template_exists:
            self.warn(("manifest template '%s' does not exist " +
                        "(using default file list)") %
                        self.template)
        self.filelist.findall()

        if self.use_defaults:
            self.add_defaults()

        if template_exists:
            self.read_template()

        if self.prune:
            self.prune_file_list()

        self.filelist.sort()
        self.filelist.remove_duplicates()
        self.write_manifest()

    def add_defaults(self):
        """Add all the default files to self.filelist:
          - README or README.txt
          - setup.py
          - test/test*.py
          - all pure Python modules mentioned in setup script
          - all files pointed by package_data (build_py)
          - all files defined in data_files.
          - all files defined as scripts.
          - all C sources listed as part of extensions or C libraries
            in the setup script (doesn't catch C headers!)
        Warns if (README or README.txt) or setup.py are missing; everything
        else is optional.
        """
        self._add_defaults_standards()
        self._add_defaults_optional()
        self._add_defaults_python()
        self._add_defaults_data_files()
        self._add_defaults_ext()
        self._add_defaults_c_libs()
        self._add_defaults_scripts()

    @staticmethod
    def _cs_path_exists(fspath):
        """
        Case-sensitive path existence check

        >>> sdist._cs_path_exists(__file__)
        True
        >>> sdist._cs_path_exists(__file__.upper())
        False
        """
        if not os.path.exists(fspath):
            return False
        # make absolute so we always have a directory
        abspath = os.path.abspath(fspath)
        directory, filename = os.path.split(abspath)
        return filename in os.listdir(directory)

    def _add_defaults_standards(self):
        standards = [self.READMES, self.distribution.script_name]
        for fn in standards:
            if isinstance(fn, tuple):
                alts = fn
                got_it = False
                for fn in alts:
                    if self._cs_path_exists(fn):
                        got_it = True
                        self.filelist.append(fn)
                        break

                if not got_it:
                    self.warn("standard file not found: should have one of " +
                              ', '.join(alts))
            else:
                if self._cs_path_exists(fn):
                    self.filelist.append(fn)
                else:
                    self.warn("standard file '%s' not found" % fn)

    def _add_defaults_optional(self):
        optional = ['test/test*.py', 'setup.cfg']
        for pattern in optional:
            files = filter(os.path.isfile, glob(pattern))
            self.filelist.extend(files)

    def _add_defaults_python(self):
        # build_py is used to get:
        #  - python modules
        #  - files defined in package_data
        build_py = self.get_finalized_command('build_py')

        # getting python files
        if self.distribution.has_pure_modules():
            self.filelist.extend(build_py.get_source_files())

        # getting package_data files
        # (computed in build_py.data_files by build_py.finalize_options)
        for pkg, src_dir, build_dir, filenames in build_py.data_files:
            for filename in filenames:
                self.filelist.append(os.path.join(src_dir, filename))

    def _add_defaults_data_files(self):
        # getting distribution.data_files
        if self.distribution.has_data_files():
            for item in self.distribution.data_files:
                if isinstance(item, str):
                    # plain file
                    item = convert_path(item)
                    if os.path.isfile(item):
                        self.filelist.append(item)
                else:
                    # a (dirname, filenames) tuple
                    dirname, filenames = item
                    for f in filenames:
                        f = convert_path(f)
                        if os.path.isfile(f):
                            self.filelist.append(f)

    def _add_defaults_ext(self):
        if self.distribution.has_ext_modules():
            build_ext = self.get_finalized_command('build_ext')
            self.filelist.extend(build_ext.get_source_files())

    def _add_defaults_c_libs(self):
        if self.distribution.has_c_libraries():
            build_clib = self.get_finalized_command('build_clib')
            self.filelist.extend(build_clib.get_source_files())

    def _add_defaults_scripts(self):
        if self.distribution.has_scripts():
            build_scripts = self.get_finalized_command('build_scripts')
            self.filelist.extend(build_scripts.get_source_files())

    def read_template(self):
        """Read and parse manifest template file named by self.template.

        (usually "MANIFEST.in") The parsing and processing is done by
        'self.filelist', which updates itself accordingly.
        """
        log.info("reading manifest template '%s'", self.template)
        template = TextFile(self.template, strip_comments=1, skip_blanks=1,
                            join_lines=1, lstrip_ws=1, rstrip_ws=1,
                            collapse_join=1)

        try:
            while True:
                line = template.readline()
                if line is None:            # end of file
                    break

                try:
                    self.filelist.process_template_line(line)
                # the call above can raise a DistutilsTemplateError for
                # malformed lines, or a ValueError from the lower-level
                # convert_path function
                except (DistutilsTemplateError, ValueError) as msg:
                    self.warn("%s, line %d: %s" % (template.filename,
                                                   template.current_line,
                                                   msg))
        finally:
            template.close()

    def prune_file_list(self):
        """Prune off branches that might slip into the file list as created
        by 'read_template()', but really don't belong there:
          * the build tree (typically "build")
          * the release tree itself (only an issue if we ran "sdist"
            previously with --keep-temp, or it aborted)
          * any RCS, CVS, .svn, .hg, .git, .bzr, _darcs directories
        """
        build = self.get_finalized_command('build')
        base_dir = self.distribution.get_fullname()

        self.filelist.exclude_pattern(None, prefix=build.build_base)
        self.filelist.exclude_pattern(None, prefix=base_dir)

        if sys.platform == 'win32':
            seps = r'/|\\'
        else:
            seps = '/'

        vcs_dirs = ['RCS', 'CVS', r'\.svn', r'\.hg', r'\.git', r'\.bzr',
                    '_darcs']
        vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps)
        self.filelist.exclude_pattern(vcs_ptrn, is_regex=1)

    def write_manifest(self):
        """Write the file list in 'self.filelist' (presumably as filled in
        by 'add_defaults()' and 'read_template()') to the manifest file
        named by 'self.manifest'.
        """
        if self._manifest_is_not_generated():
            log.info("not writing to manually maintained "
                     "manifest file '%s'" % self.manifest)
            return

        content = self.filelist.files[:]
        content.insert(0, '# file GENERATED by distutils, do NOT edit')
        self.execute(file_util.write_file, (self.manifest, content),
                     "writing manifest file '%s'" % self.manifest)

    def _manifest_is_not_generated(self):
        # check for special comment used in 3.1.3 and higher
        if not os.path.isfile(self.manifest):
            return False

        fp = open(self.manifest)
        try:
            first_line = fp.readline()
        finally:
            fp.close()
        return first_line != '# file GENERATED by distutils, do NOT edit\n'

    def read_manifest(self):
        """Read the manifest file (named by 'self.manifest') and use it to
        fill in 'self.filelist', the list of files to include in the source
        distribution.
        """
        log.info("reading manifest file '%s'", self.manifest)
        with open(self.manifest) as manifest:
            for line in manifest:
                # ignore comments and blank lines
                line = line.strip()
                if line.startswith('#') or not line:
                    continue
                self.filelist.append(line)

    def make_release_tree(self, base_dir, files):
        """Create the directory tree that will become the source
        distribution archive.  All directories implied by the filenames in
        'files' are created under 'base_dir', and then we hard link or copy
        (if hard linking is unavailable) those files into place.
        Essentially, this duplicates the developer's source tree, but in a
        directory named after the distribution, containing only the files
        to be distributed.
        """
        # Create all the directories under 'base_dir' necessary to
        # put 'files' there; the 'mkpath()' is just so we don't die
        # if the manifest happens to be empty.
        self.mkpath(base_dir)
        dir_util.create_tree(base_dir, files, dry_run=self.dry_run)

        # And walk over the list of files, either making a hard link (if
        # os.link exists) to each one that doesn't already exist in its
        # corresponding location under 'base_dir', or copying each file
        # that's out-of-date in 'base_dir'.  (Usually, all files will be
        # out-of-date, because by default we blow away 'base_dir' when
        # we're done making the distribution archives.)

        if hasattr(os, 'link'):        # can make hard links on this system
            link = 'hard'
            msg = "making hard links in %s..." % base_dir
        else:                           # nope, have to copy
            link = None
            msg = "copying files to %s..." % base_dir

        if not files:
            log.warn("no files to distribute -- empty manifest?")
        else:
            log.info(msg)
        for file in files:
            if not os.path.isfile(file):
                log.warn("'%s' not a regular file -- skipping", file)
            else:
                dest = os.path.join(base_dir, file)
                self.copy_file(file, dest, link=link)

        self.distribution.metadata.write_pkg_info(base_dir)

    def make_distribution(self):
        """Create the source distribution(s).  First, we create the release
        tree with 'make_release_tree()'; then, we create all required
        archive files (according to 'self.formats') from the release tree.
        Finally, we clean up by blowing away the release tree (unless
        'self.keep_temp' is true).  The list of archive files created is
        stored so it can be retrieved later by 'get_archive_files()'.
        """
        # Don't warn about missing meta-data here -- should be (and is!)
        # done elsewhere.
        base_dir = self.distribution.get_fullname()
        base_name = os.path.join(self.dist_dir, base_dir)

        self.make_release_tree(base_dir, self.filelist.files)
        archive_files = []              # remember names of files we create
        # tar archive must be created last to avoid overwrite and remove
        if 'tar' in self.formats:
            self.formats.append(self.formats.pop(self.formats.index('tar')))

        for fmt in self.formats:
            file = self.make_archive(base_name, fmt, base_dir=base_dir,
                                     owner=self.owner, group=self.group)
            archive_files.append(file)
            self.distribution.dist_files.append(('sdist', '', file))

        self.archive_files = archive_files

        if not self.keep_temp:
            dir_util.remove_tree(base_dir, dry_run=self.dry_run)

    def get_archive_files(self):
        """Return the list of archive files created when the command
        was run, or None if the command hasn't run yet.
        """
        return self.archive_files
build_py.py000064400000041446150513660070006741 0ustar00"""distutils.command.build_py

Implements the Distutils 'build_py' command."""

import os
import importlib.util
import sys
import glob

from distutils.core import Command
from distutils.errors import *
from distutils.util import convert_path, Mixin2to3
from distutils import log

class build_py (Command):

    description = "\"build\" pure Python modules (copy to build directory)"

    user_options = [
        ('build-lib=', 'd', "directory to \"build\" (copy) to"),
        ('compile', 'c', "compile .py to .pyc"),
        ('no-compile', None, "don't compile .py files [default]"),
        ('optimize=', 'O',
         "also compile with optimization: -O1 for \"python -O\", "
         "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"),
        ('force', 'f', "forcibly build everything (ignore file timestamps)"),
        ]

    boolean_options = ['compile', 'force']
    negative_opt = {'no-compile' : 'compile'}

    def initialize_options(self):
        self.build_lib = None
        self.py_modules = None
        self.package = None
        self.package_data = None
        self.package_dir = None
        self.compile = 0
        self.optimize = 0
        self.force = None

    def finalize_options(self):
        self.set_undefined_options('build',
                                   ('build_lib', 'build_lib'),
                                   ('force', 'force'))

        # Get the distribution options that are aliases for build_py
        # options -- list of packages and list of modules.
        self.packages = self.distribution.packages
        self.py_modules = self.distribution.py_modules
        self.package_data = self.distribution.package_data
        self.package_dir = {}
        if self.distribution.package_dir:
            for name, path in self.distribution.package_dir.items():
                self.package_dir[name] = convert_path(path)
        self.data_files = self.get_data_files()

        # Ick, copied straight from install_lib.py (fancy_getopt needs a
        # type system!  Hell, *everything* needs a type system!!!)
        if not isinstance(self.optimize, int):
            try:
                self.optimize = int(self.optimize)
                assert 0 <= self.optimize <= 2
            except (ValueError, AssertionError):
                raise DistutilsOptionError("optimize must be 0, 1, or 2")

    def run(self):
        # XXX copy_file by default preserves atime and mtime.  IMHO this is
        # the right thing to do, but perhaps it should be an option -- in
        # particular, a site administrator might want installed files to
        # reflect the time of installation rather than the last
        # modification time before the installed release.

        # XXX copy_file by default preserves mode, which appears to be the
        # wrong thing to do: if a file is read-only in the working
        # directory, we want it to be installed read/write so that the next
        # installation of the same module distribution can overwrite it
        # without problems.  (This might be a Unix-specific issue.)  Thus
        # we turn off 'preserve_mode' when copying to the build directory,
        # since the build directory is supposed to be exactly what the
        # installation will look like (ie. we preserve mode when
        # installing).

        # Two options control which modules will be installed: 'packages'
        # and 'py_modules'.  The former lets us work with whole packages, not
        # specifying individual modules at all; the latter is for
        # specifying modules one-at-a-time.

        if self.py_modules:
            self.build_modules()
        if self.packages:
            self.build_packages()
            self.build_package_data()

        self.byte_compile(self.get_outputs(include_bytecode=0))

    def get_data_files(self):
        """Generate list of '(package,src_dir,build_dir,filenames)' tuples"""
        data = []
        if not self.packages:
            return data
        for package in self.packages:
            # Locate package source directory
            src_dir = self.get_package_dir(package)

            # Compute package build directory
            build_dir = os.path.join(*([self.build_lib] + package.split('.')))

            # Length of path to strip from found files
            plen = 0
            if src_dir:
                plen = len(src_dir)+1

            # Strip directory from globbed filenames
            filenames = [
                file[plen:] for file in self.find_data_files(package, src_dir)
                ]
            data.append((package, src_dir, build_dir, filenames))
        return data

    def find_data_files(self, package, src_dir):
        """Return filenames for package's data files in 'src_dir'"""
        globs = (self.package_data.get('', [])
                 + self.package_data.get(package, []))
        files = []
        for pattern in globs:
            # Each pattern has to be converted to a platform-specific path
            filelist = glob.glob(os.path.join(glob.escape(src_dir), convert_path(pattern)))
            # Files that match more than one pattern are only added once
            files.extend([fn for fn in filelist if fn not in files
                and os.path.isfile(fn)])
        return files

    def build_package_data(self):
        """Copy data files into build directory"""
        lastdir = None
        for package, src_dir, build_dir, filenames in self.data_files:
            for filename in filenames:
                target = os.path.join(build_dir, filename)
                self.mkpath(os.path.dirname(target))
                self.copy_file(os.path.join(src_dir, filename), target,
                               preserve_mode=False)

    def get_package_dir(self, package):
        """Return the directory, relative to the top of the source
           distribution, where package 'package' should be found
           (at least according to the 'package_dir' option, if any)."""
        path = package.split('.')

        if not self.package_dir:
            if path:
                return os.path.join(*path)
            else:
                return ''
        else:
            tail = []
            while path:
                try:
                    pdir = self.package_dir['.'.join(path)]
                except KeyError:
                    tail.insert(0, path[-1])
                    del path[-1]
                else:
                    tail.insert(0, pdir)
                    return os.path.join(*tail)
            else:
                # Oops, got all the way through 'path' without finding a
                # match in package_dir.  If package_dir defines a directory
                # for the root (nameless) package, then fallback on it;
                # otherwise, we might as well have not consulted
                # package_dir at all, as we just use the directory implied
                # by 'tail' (which should be the same as the original value
                # of 'path' at this point).
                pdir = self.package_dir.get('')
                if pdir is not None:
                    tail.insert(0, pdir)

                if tail:
                    return os.path.join(*tail)
                else:
                    return ''

    def check_package(self, package, package_dir):
        # Empty dir name means current directory, which we can probably
        # assume exists.  Also, os.path.exists and isdir don't know about
        # my "empty string means current dir" convention, so we have to
        # circumvent them.
        if package_dir != "":
            if not os.path.exists(package_dir):
                raise DistutilsFileError(
                      "package directory '%s' does not exist" % package_dir)
            if not os.path.isdir(package_dir):
                raise DistutilsFileError(
                       "supposed package directory '%s' exists, "
                       "but is not a directory" % package_dir)

        # Require __init__.py for all but the "root package"
        if package:
            init_py = os.path.join(package_dir, "__init__.py")
            if os.path.isfile(init_py):
                return init_py
            else:
                log.warn(("package init file '%s' not found " +
                          "(or not a regular file)"), init_py)

        # Either not in a package at all (__init__.py not expected), or
        # __init__.py doesn't exist -- so don't return the filename.
        return None

    def check_module(self, module, module_file):
        if not os.path.isfile(module_file):
            log.warn("file %s (for module %s) not found", module_file, module)
            return False
        else:
            return True

    def find_package_modules(self, package, package_dir):
        self.check_package(package, package_dir)
        module_files = glob.glob(os.path.join(glob.escape(package_dir), "*.py"))
        modules = []
        setup_script = os.path.abspath(self.distribution.script_name)

        for f in module_files:
            abs_f = os.path.abspath(f)
            if abs_f != setup_script:
                module = os.path.splitext(os.path.basename(f))[0]
                modules.append((package, module, f))
            else:
                self.debug_print("excluding %s" % setup_script)
        return modules

    def find_modules(self):
        """Finds individually-specified Python modules, ie. those listed by
        module name in 'self.py_modules'.  Returns a list of tuples (package,
        module_base, filename): 'package' is a tuple of the path through
        package-space to the module; 'module_base' is the bare (no
        packages, no dots) module name, and 'filename' is the path to the
        ".py" file (relative to the distribution root) that implements the
        module.
        """
        # Map package names to tuples of useful info about the package:
        #    (package_dir, checked)
        # package_dir - the directory where we'll find source files for
        #   this package
        # checked - true if we have checked that the package directory
        #   is valid (exists, contains __init__.py, ... ?)
        packages = {}

        # List of (package, module, filename) tuples to return
        modules = []

        # We treat modules-in-packages almost the same as toplevel modules,
        # just the "package" for a toplevel is empty (either an empty
        # string or empty list, depending on context).  Differences:
        #   - don't check for __init__.py in directory for empty package
        for module in self.py_modules:
            path = module.split('.')
            package = '.'.join(path[0:-1])
            module_base = path[-1]

            try:
                (package_dir, checked) = packages[package]
            except KeyError:
                package_dir = self.get_package_dir(package)
                checked = 0

            if not checked:
                init_py = self.check_package(package, package_dir)
                packages[package] = (package_dir, 1)
                if init_py:
                    modules.append((package, "__init__", init_py))

            # XXX perhaps we should also check for just .pyc files
            # (so greedy closed-source bastards can distribute Python
            # modules too)
            module_file = os.path.join(package_dir, module_base + ".py")
            if not self.check_module(module, module_file):
                continue

            modules.append((package, module_base, module_file))

        return modules

    def find_all_modules(self):
        """Compute the list of all modules that will be built, whether
        they are specified one-module-at-a-time ('self.py_modules') or
        by whole packages ('self.packages').  Return a list of tuples
        (package, module, module_file), just like 'find_modules()' and
        'find_package_modules()' do."""
        modules = []
        if self.py_modules:
            modules.extend(self.find_modules())
        if self.packages:
            for package in self.packages:
                package_dir = self.get_package_dir(package)
                m = self.find_package_modules(package, package_dir)
                modules.extend(m)
        return modules

    def get_source_files(self):
        return [module[-1] for module in self.find_all_modules()]

    def get_module_outfile(self, build_dir, package, module):
        outfile_path = [build_dir] + list(package) + [module + ".py"]
        return os.path.join(*outfile_path)

    def get_outputs(self, include_bytecode=1):
        modules = self.find_all_modules()
        outputs = []
        for (package, module, module_file) in modules:
            package = package.split('.')
            filename = self.get_module_outfile(self.build_lib, package, module)
            outputs.append(filename)
            if include_bytecode:
                if self.compile:
                    outputs.append(importlib.util.cache_from_source(
                        filename, optimization=''))
                if self.optimize > 0:
                    outputs.append(importlib.util.cache_from_source(
                        filename, optimization=self.optimize))

        outputs += [
            os.path.join(build_dir, filename)
            for package, src_dir, build_dir, filenames in self.data_files
            for filename in filenames
            ]

        return outputs

    def build_module(self, module, module_file, package):
        if isinstance(package, str):
            package = package.split('.')
        elif not isinstance(package, (list, tuple)):
            raise TypeError(
                  "'package' must be a string (dot-separated), list, or tuple")

        # Now put the module source file into the "build" area -- this is
        # easy, we just copy it somewhere under self.build_lib (the build
        # directory for Python source).
        outfile = self.get_module_outfile(self.build_lib, package, module)
        dir = os.path.dirname(outfile)
        self.mkpath(dir)
        return self.copy_file(module_file, outfile, preserve_mode=0)

    def build_modules(self):
        modules = self.find_modules()
        for (package, module, module_file) in modules:
            # Now "build" the module -- ie. copy the source file to
            # self.build_lib (the build directory for Python source).
            # (Actually, it gets copied to the directory for this package
            # under self.build_lib.)
            self.build_module(module, module_file, package)

    def build_packages(self):
        for package in self.packages:
            # Get list of (package, module, module_file) tuples based on
            # scanning the package directory.  'package' is only included
            # in the tuple so that 'find_modules()' and
            # 'find_package_tuples()' have a consistent interface; it's
            # ignored here (apart from a sanity check).  Also, 'module' is
            # the *unqualified* module name (ie. no dots, no package -- we
            # already know its package!), and 'module_file' is the path to
            # the .py file, relative to the current directory
            # (ie. including 'package_dir').
            package_dir = self.get_package_dir(package)
            modules = self.find_package_modules(package, package_dir)

            # Now loop over the modules we found, "building" each one (just
            # copy it to self.build_lib).
            for (package_, module, module_file) in modules:
                assert package == package_
                self.build_module(module, module_file, package)

    def byte_compile(self, files):
        if sys.dont_write_bytecode:
            self.warn('byte-compiling is disabled, skipping.')
            return

        from distutils.util import byte_compile
        prefix = self.build_lib
        if prefix[-1] != os.sep:
            prefix = prefix + os.sep

        # XXX this code is essentially the same as the 'byte_compile()
        # method of the "install_lib" command, except for the determination
        # of the 'prefix' string.  Hmmm.
        if self.compile:
            byte_compile(files, optimize=0,
                         force=self.force, prefix=prefix, dry_run=self.dry_run)
        if self.optimize > 0:
            byte_compile(files, optimize=self.optimize,
                         force=self.force, prefix=prefix, dry_run=self.dry_run)

class build_py_2to3(build_py, Mixin2to3):
    def run(self):
        self.updated_files = []

        # Base class code
        if self.py_modules:
            self.build_modules()
        if self.packages:
            self.build_packages()
            self.build_package_data()

        # 2to3
        self.run_2to3(self.updated_files)

        # Remaining base class code
        self.byte_compile(self.get_outputs(include_bytecode=0))

    def build_module(self, module, module_file, package):
        res = build_py.build_module(self, module, module_file, package)
        if res[1]:
            # file was copied
            self.updated_files.append(res[0])
        return res
build_ext.py000064400000075520150513660100007103 0ustar00"""distutils.command.build_ext

Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP)."""

import contextlib
import os
import re
import sys
from distutils.core import Command
from distutils.errors import *
from distutils.sysconfig import customize_compiler, get_python_version
from distutils.sysconfig import get_config_h_filename
from distutils.dep_util import newer_group
from distutils.extension import Extension
from distutils.util import get_platform
from distutils import log

from site import USER_BASE

# An extension name is just a dot-separated list of Python NAMEs (ie.
# the same as a fully-qualified module name).
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)"

    # XXX thoughts on how to deal with complex command-line options like
    # these, i.e. how to make it so fancy_getopt can suck them off the
    # command line and make it look like setup.py defined the appropriate
    # lists of tuples of what-have-you.
    #   - each command needs a callback to process its command-line options
    #   - Command.__init__() needs access to its share of the whole
    #     command line (must ultimately come from
    #     Distribution.parse_command_line())
    #   - it then calls the current command class' option-parsing
    #     callback to deal with weird options like -D, which have to
    #     parse the option text and churn out some custom data
    #     structure
    #   - that data structure (in this case, a list of 2-tuples)
    #     will then be present in the command object by the time
    #     we get to finalize_options() (i.e. the constructor
    #     takes care of both command-line and client options
    #     in between initialize_options() and finalize_options())

    sep_by = " (separated by '%s')" % os.pathsep
    user_options = [
        ('build-lib=', 'b',
         "directory for compiled extension modules"),
        ('build-temp=', 't',
         "directory for temporary files (build by-products)"),
        ('plat-name=', 'p',
         "platform name to cross-compile for, if supported "
         "(default: %s)" % get_platform()),
        ('inplace', 'i',
         "ignore build-lib and put compiled extensions into the source " +
         "directory alongside your pure Python modules"),
        ('include-dirs=', 'I',
         "list of directories to search for header files" + sep_by),
        ('define=', 'D',
         "C preprocessor macros to define"),
        ('undef=', 'U',
         "C preprocessor macros to undefine"),
        ('libraries=', 'l',
         "external C libraries to link with"),
        ('library-dirs=', 'L',
         "directories to search for external C libraries" + sep_by),
        ('rpath=', 'R',
         "directories to search for shared C libraries at runtime"),
        ('link-objects=', 'O',
         "extra explicit link objects to include in the link"),
        ('debug', 'g',
         "compile/link with debugging information"),
        ('force', 'f',
         "forcibly build everything (ignore file timestamps)"),
        ('compiler=', 'c',
         "specify the compiler type"),
        ('parallel=', 'j',
         "number of parallel build jobs"),
        ('swig-cpp', None,
         "make SWIG create C++ files (default is C)"),
        ('swig-opts=', None,
         "list of SWIG command line options"),
        ('swig=', None,
         "path to the SWIG executable"),
        ('user', None,
         "add user include, library and rpath")
        ]

    boolean_options = ['inplace', 'debug', 'force', 'swig-cpp', 'user']

    help_options = [
        ('help-compiler', None,
         "list available compilers", show_compilers),
        ]

    def initialize_options(self):
        self.extensions = None
        self.build_lib = None
        self.plat_name = None
        self.build_temp = None
        self.inplace = 0
        self.package = None

        self.include_dirs = None
        self.define = None
        self.undef = None
        self.libraries = None
        self.library_dirs = None
        self.rpath = None
        self.link_objects = None
        self.debug = None
        self.force = None
        self.compiler = None
        self.swig = None
        self.swig_cpp = None
        self.swig_opts = None
        self.user = None
        self.parallel = None

    def finalize_options(self):
        from distutils import sysconfig

        self.set_undefined_options('build',
                                   ('build_lib', 'build_lib'),
                                   ('build_temp', 'build_temp'),
                                   ('compiler', 'compiler'),
                                   ('debug', 'debug'),
                                   ('force', 'force'),
                                   ('parallel', 'parallel'),
                                   ('plat_name', 'plat_name'),
                                   )

        if self.package is None:
            self.package = self.distribution.ext_package

        self.extensions = self.distribution.ext_modules

        # Make sure Python's include directories (for Python.h, pyconfig.h,
        # etc.) are in the include search path.
        py_include = sysconfig.get_python_inc()
        plat_py_include = sysconfig.get_python_inc(plat_specific=1)
        if self.include_dirs is None:
            self.include_dirs = self.distribution.include_dirs or []
        if isinstance(self.include_dirs, str):
            self.include_dirs = self.include_dirs.split(os.pathsep)

        # If in a virtualenv, add its include directory
        # Issue 16116
        if sys.exec_prefix != sys.base_exec_prefix:
            self.include_dirs.append(os.path.join(sys.exec_prefix, 'include'))

        # Put the Python "system" include dir at the end, so that
        # any local include dirs take precedence.
        self.include_dirs.extend(py_include.split(os.path.pathsep))
        if plat_py_include != py_include:
            self.include_dirs.extend(
                plat_py_include.split(os.path.pathsep))

        self.ensure_string_list('libraries')
        self.ensure_string_list('link_objects')

        # Life is easier if we're not forever checking for None, so
        # simplify these options to empty lists if unset
        if self.libraries is None:
            self.libraries = []
        if self.library_dirs is None:
            self.library_dirs = []
        elif isinstance(self.library_dirs, str):
            self.library_dirs = self.library_dirs.split(os.pathsep)

        if self.rpath is None:
            self.rpath = []
        elif isinstance(self.rpath, str):
            self.rpath = self.rpath.split(os.pathsep)

        # for extensions under windows use different directories
        # for Release and Debug builds.
        # also Python's library directory must be appended to library_dirs
        if os.name == 'nt':
            # the 'libs' directory is for binary installs - we assume that
            # must be the *native* platform.  But we don't really support
            # cross-compiling via a binary install anyway, so we let it go.
            self.library_dirs.append(os.path.join(sys.exec_prefix, 'libs'))
            if sys.base_exec_prefix != sys.prefix:  # Issue 16116
                self.library_dirs.append(os.path.join(sys.base_exec_prefix, 'libs'))
            if self.debug:
                self.build_temp = os.path.join(self.build_temp, "Debug")
            else:
                self.build_temp = os.path.join(self.build_temp, "Release")

            # Append the source distribution include and library directories,
            # this allows distutils on windows to work in the source tree
            self.include_dirs.append(os.path.dirname(get_config_h_filename()))
            _sys_home = getattr(sys, '_home', None)
            if _sys_home:
                self.library_dirs.append(_sys_home)

            # Use the .lib files for the correct architecture
            if self.plat_name == 'win32':
                suffix = 'win32'
            else:
                # win-amd64
                suffix = self.plat_name[4:]
            new_lib = os.path.join(sys.exec_prefix, 'PCbuild')
            if suffix:
                new_lib = os.path.join(new_lib, suffix)
            self.library_dirs.append(new_lib)

        # For extensions under Cygwin, Python's library directory must be
        # appended to library_dirs
        if sys.platform[:6] == 'cygwin':
            if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
                # building third party extensions
                self.library_dirs.append(os.path.join(sys.prefix, "lib",
                                                      "python" + get_python_version(),
                                                      "config"))
            else:
                # building python standard extensions
                self.library_dirs.append('.')

        # For building extensions with a shared Python library,
        # Python's library directory must be appended to library_dirs
        # See Issues: #1600860, #4366
        if (sysconfig.get_config_var('Py_ENABLE_SHARED')):
            if not sysconfig.python_build:
                # building third party extensions
                self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))
            else:
                # building python standard extensions
                self.library_dirs.append('.')

        # The argument parsing will result in self.define being a string, but
        # it has to be a list of 2-tuples.  All the preprocessor symbols
        # specified by the 'define' option will be set to '1'.  Multiple
        # symbols can be separated with commas.

        if self.define:
            defines = self.define.split(',')
            self.define = [(symbol, '1') for symbol in defines]

        # The option for macros to undefine is also a string from the
        # option parsing, but has to be a list.  Multiple symbols can also
        # be separated with commas here.
        if self.undef:
            self.undef = self.undef.split(',')

        if self.swig_opts is None:
            self.swig_opts = []
        else:
            self.swig_opts = self.swig_opts.split(' ')

        # Finally add the user include and library directories if requested
        if self.user:
            user_include = os.path.join(USER_BASE, "include")
            user_lib = os.path.join(USER_BASE, "lib")
            if os.path.isdir(user_include):
                self.include_dirs.append(user_include)
            if os.path.isdir(user_lib):
                self.library_dirs.append(user_lib)
                self.rpath.append(user_lib)

        if isinstance(self.parallel, str):
            try:
                self.parallel = int(self.parallel)
            except ValueError:
                raise DistutilsOptionError("parallel should be an integer")

    def run(self):
        from distutils.ccompiler import new_compiler

        # 'self.extensions', as supplied by setup.py, is a list of
        # Extension instances.  See the documentation for Extension (in
        # distutils.extension) for details.
        #
        # For backwards compatibility with Distutils 0.8.2 and earlier, we
        # also allow the 'extensions' list to be a list of tuples:
        #    (ext_name, build_info)
        # where build_info is a dictionary containing everything that
        # Extension instances do except the name, with a few things being
        # differently named.  We convert these 2-tuples to Extension
        # instances as needed.

        if not self.extensions:
            return

        # If we were asked to build any C/C++ libraries, make sure that the
        # directory where we put them is in the library search path for
        # linking extensions.
        if self.distribution.has_c_libraries():
            build_clib = self.get_finalized_command('build_clib')
            self.libraries.extend(build_clib.get_library_names() or [])
            self.library_dirs.append(build_clib.build_clib)

        # Setup the CCompiler object that we'll use to do all the
        # compiling and linking
        self.compiler = new_compiler(compiler=self.compiler,
                                     verbose=self.verbose,
                                     dry_run=self.dry_run,
                                     force=self.force)
        customize_compiler(self.compiler)
        # If we are cross-compiling, init the compiler now (if we are not
        # cross-compiling, init would not hurt, but people may rely on
        # late initialization of compiler even if they shouldn't...)
        if os.name == 'nt' and self.plat_name != get_platform():
            self.compiler.initialize(self.plat_name)

        # And make sure that any compile/link-related options (which might
        # come from the command-line or from the setup script) are set in
        # that CCompiler object -- that way, they automatically apply to
        # all compiling and linking done here.
        if self.include_dirs is not None:
            self.compiler.set_include_dirs(self.include_dirs)
        if self.define is not None:
            # 'define' option is a list of (name,value) tuples
            for (name, value) in self.define:
                self.compiler.define_macro(name, value)
        if self.undef is not None:
            for macro in self.undef:
                self.compiler.undefine_macro(macro)
        if self.libraries is not None:
            self.compiler.set_libraries(self.libraries)
        if self.library_dirs is not None:
            self.compiler.set_library_dirs(self.library_dirs)
        if self.rpath is not None:
            self.compiler.set_runtime_library_dirs(self.rpath)
        if self.link_objects is not None:
            self.compiler.set_link_objects(self.link_objects)

        # Now actually compile and link everything.
        self.build_extensions()

    def check_extensions_list(self, extensions):
        """Ensure that the list of extensions (presumably provided as a
        command option 'extensions') is valid, i.e. it is a list of
        Extension objects.  We also support the old-style list of 2-tuples,
        where the tuples are (ext_name, build_info), which are converted to
        Extension instances here.

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        """
        if not isinstance(extensions, list):
            raise DistutilsSetupError(
                  "'ext_modules' option must be a list of Extension instances")

        for i, ext in enumerate(extensions):
            if isinstance(ext, Extension):
                continue                # OK! (assume type-checking done
                                        # by Extension constructor)

            if not isinstance(ext, tuple) or len(ext) != 2:
                raise DistutilsSetupError(
                       "each element of 'ext_modules' option must be an "
                       "Extension instance or 2-tuple")

            ext_name, build_info = ext

            log.warn("old-style (ext_name, build_info) tuple found in "
                     "ext_modules for extension '%s' "
                     "-- please convert to Extension instance", ext_name)

            if not (isinstance(ext_name, str) and
                    extension_name_re.match(ext_name)):
                raise DistutilsSetupError(
                       "first element of each tuple in 'ext_modules' "
                       "must be the extension name (a string)")

            if not isinstance(build_info, dict):
                raise DistutilsSetupError(
                       "second element of each tuple in 'ext_modules' "
                       "must be a dictionary (build info)")

            # OK, the (ext_name, build_info) dict is type-safe: convert it
            # to an Extension instance.
            ext = Extension(ext_name, build_info['sources'])

            # Easy stuff: one-to-one mapping from dict elements to
            # instance attributes.
            for key in ('include_dirs', 'library_dirs', 'libraries',
                        'extra_objects', 'extra_compile_args',
                        'extra_link_args'):
                val = build_info.get(key)
                if val is not None:
                    setattr(ext, key, val)

            # Medium-easy stuff: same syntax/semantics, different names.
            ext.runtime_library_dirs = build_info.get('rpath')
            if 'def_file' in build_info:
                log.warn("'def_file' element of build info dict "
                         "no longer supported")

            # Non-trivial stuff: 'macros' split into 'define_macros'
            # and 'undef_macros'.
            macros = build_info.get('macros')
            if macros:
                ext.define_macros = []
                ext.undef_macros = []
                for macro in macros:
                    if not (isinstance(macro, tuple) and len(macro) in (1, 2)):
                        raise DistutilsSetupError(
                              "'macros' element of build info dict "
                              "must be 1- or 2-tuple")
                    if len(macro) == 1:
                        ext.undef_macros.append(macro[0])
                    elif len(macro) == 2:
                        ext.define_macros.append(macro)

            extensions[i] = ext

    def get_source_files(self):
        self.check_extensions_list(self.extensions)
        filenames = []

        # Wouldn't it be neat if we knew the names of header files too...
        for ext in self.extensions:
            filenames.extend(ext.sources)
        return filenames

    def get_outputs(self):
        # Sanity check the 'extensions' list -- can't assume this is being
        # done in the same run as a 'build_extensions()' call (in fact, we
        # can probably assume that it *isn't*!).
        self.check_extensions_list(self.extensions)

        # And build the list of output (built) filenames.  Note that this
        # ignores the 'inplace' flag, and assumes everything goes in the
        # "build" tree.
        outputs = []
        for ext in self.extensions:
            outputs.append(self.get_ext_fullpath(ext.name))
        return outputs

    def build_extensions(self):
        # First, sanity-check the 'extensions' list
        self.check_extensions_list(self.extensions)
        if self.parallel:
            self._build_extensions_parallel()
        else:
            self._build_extensions_serial()

    def _build_extensions_parallel(self):
        workers = self.parallel
        if self.parallel is True:
            workers = os.cpu_count()  # may return None
        try:
            from concurrent.futures import ThreadPoolExecutor
        except ImportError:
            workers = None

        if workers is None:
            self._build_extensions_serial()
            return

        with ThreadPoolExecutor(max_workers=workers) as executor:
            futures = [executor.submit(self.build_extension, ext)
                       for ext in self.extensions]
            for ext, fut in zip(self.extensions, futures):
                with self._filter_build_errors(ext):
                    fut.result()

    def _build_extensions_serial(self):
        for ext in self.extensions:
            with self._filter_build_errors(ext):
                self.build_extension(ext)

    @contextlib.contextmanager
    def _filter_build_errors(self, ext):
        try:
            yield
        except (CCompilerError, DistutilsError, CompileError) as e:
            if not ext.optional:
                raise
            self.warn('building extension "%s" failed: %s' %
                      (ext.name, e))

    def build_extension(self, ext):
        sources = ext.sources
        if sources is None or not isinstance(sources, (list, tuple)):
            raise DistutilsSetupError(
                  "in 'ext_modules' option (extension '%s'), "
                  "'sources' must be present and must be "
                  "a list of source filenames" % ext.name)
        sources = list(sources)

        ext_path = self.get_ext_fullpath(ext.name)
        depends = sources + ext.depends
        if not (self.force or newer_group(depends, ext_path, 'newer')):
            log.debug("skipping '%s' extension (up-to-date)", ext.name)
            return
        else:
            log.info("building '%s' extension", ext.name)

        # First, scan the sources for SWIG definition files (.i), run
        # SWIG on 'em to create .c files, and modify the sources list
        # accordingly.
        sources = self.swig_sources(sources, ext)

        # Next, compile the source code to object files.

        # XXX not honouring 'define_macros' or 'undef_macros' -- the
        # CCompiler API needs to change to accommodate this, and I
        # want to do one thing at a time!

        # Two possible sources for extra compiler arguments:
        #   - 'extra_compile_args' in Extension object
        #   - CFLAGS environment variable (not particularly
        #     elegant, but people seem to expect it and I
        #     guess it's useful)
        # The environment variable should take precedence, and
        # any sensible compiler will give precedence to later
        # command line args.  Hence we combine them in order:
        extra_args = ext.extra_compile_args or []

        macros = ext.define_macros[:]
        for undef in ext.undef_macros:
            macros.append((undef,))

        objects = self.compiler.compile(sources,
                                         output_dir=self.build_temp,
                                         macros=macros,
                                         include_dirs=ext.include_dirs,
                                         debug=self.debug,
                                         extra_postargs=extra_args,
                                         depends=ext.depends)

        # XXX outdated variable, kept here in case third-part code
        # needs it.
        self._built_objects = objects[:]

        # Now link the object files together into a "shared object" --
        # of course, first we have to figure out all the other things
        # that go into the mix.
        if ext.extra_objects:
            objects.extend(ext.extra_objects)
        extra_args = ext.extra_link_args or []

        # Detect target language, if not provided
        language = ext.language or self.compiler.detect_language(sources)

        self.compiler.link_shared_object(
            objects, ext_path,
            libraries=self.get_libraries(ext),
            library_dirs=ext.library_dirs,
            runtime_library_dirs=ext.runtime_library_dirs,
            extra_postargs=extra_args,
            export_symbols=self.get_export_symbols(ext),
            debug=self.debug,
            build_temp=self.build_temp,
            target_lang=language)

    def swig_sources(self, sources, extension):
        """Walk the list of source files in 'sources', looking for SWIG
        interface (.i) files.  Run SWIG on all that are found, and
        return a modified 'sources' list with SWIG source files replaced
        by the generated C (or C++) files.
        """
        new_sources = []
        swig_sources = []
        swig_targets = {}

        # XXX this drops generated C/C++ files into the source tree, which
        # is fine for developers who want to distribute the generated
        # source -- but there should be an option to put SWIG output in
        # the temp dir.

        if self.swig_cpp:
            log.warn("--swig-cpp is deprecated - use --swig-opts=-c++")

        if self.swig_cpp or ('-c++' in self.swig_opts) or \
           ('-c++' in extension.swig_opts):
            target_ext = '.cpp'
        else:
            target_ext = '.c'

        for source in sources:
            (base, ext) = os.path.splitext(source)
            if ext == ".i":             # SWIG interface file
                new_sources.append(base + '_wrap' + target_ext)
                swig_sources.append(source)
                swig_targets[source] = new_sources[-1]
            else:
                new_sources.append(source)

        if not swig_sources:
            return new_sources

        swig = self.swig or self.find_swig()
        swig_cmd = [swig, "-python"]
        swig_cmd.extend(self.swig_opts)
        if self.swig_cpp:
            swig_cmd.append("-c++")

        # Do not override commandline arguments
        if not self.swig_opts:
            for o in extension.swig_opts:
                swig_cmd.append(o)

        for source in swig_sources:
            target = swig_targets[source]
            log.info("swigging %s to %s", source, target)
            self.spawn(swig_cmd + ["-o", target, source])

        return new_sources

    def find_swig(self):
        """Return the name of the SWIG executable.  On Unix, this is
        just "swig" -- it should be in the PATH.  Tries a bit harder on
        Windows.
        """
        if os.name == "posix":
            return "swig"
        elif os.name == "nt":
            # Look for SWIG in its standard installation directory on
            # Windows (or so I presume!).  If we find it there, great;
            # if not, act like Unix and assume it's in the PATH.
            for vers in ("1.3", "1.2", "1.1"):
                fn = os.path.join("c:\\swig%s" % vers, "swig.exe")
                if os.path.isfile(fn):
                    return fn
            else:
                return "swig.exe"
        else:
            raise DistutilsPlatformError(
                  "I don't know how to find (much less run) SWIG "
                  "on platform '%s'" % os.name)

    # -- Name generators -----------------------------------------------
    # (extension names, filenames, whatever)
    def get_ext_fullpath(self, ext_name):
        """Returns the path of the filename for a given extension.

        The file is located in `build_lib` or directly in the package
        (inplace option).
        """
        fullname = self.get_ext_fullname(ext_name)
        modpath = fullname.split('.')
        filename = self.get_ext_filename(modpath[-1])

        if not self.inplace:
            # no further work needed
            # returning :
            #   build_dir/package/path/filename
            filename = os.path.join(*modpath[:-1]+[filename])
            return os.path.join(self.build_lib, filename)

        # the inplace option requires to find the package directory
        # using the build_py command for that
        package = '.'.join(modpath[0:-1])
        build_py = self.get_finalized_command('build_py')
        package_dir = os.path.abspath(build_py.get_package_dir(package))

        # returning
        #   package_dir/filename
        return os.path.join(package_dir, filename)

    def get_ext_fullname(self, ext_name):
        """Returns the fullname of a given extension name.

        Adds the `package.` prefix"""
        if self.package is None:
            return ext_name
        else:
            return self.package + '.' + ext_name

    def get_ext_filename(self, ext_name):
        r"""Convert the name of an extension (eg. "foo.bar") into the name
        of the file from which it will be loaded (eg. "foo/bar.so", or
        "foo\bar.pyd").
        """
        from distutils.sysconfig import get_config_var
        ext_path = ext_name.split('.')
        ext_suffix = get_config_var('EXT_SUFFIX')
        return os.path.join(*ext_path) + ext_suffix

    def get_export_symbols(self, ext):
        """Return the list of symbols that a shared extension has to
        export.  This either uses 'ext.export_symbols' or, if it's not
        provided, "PyInit_" + module_name.  Only relevant on Windows, where
        the .pyd file (DLL) must export the module "PyInit_" function.
        """
        suffix = '_' + ext.name.split('.')[-1]
        try:
            # Unicode module name support as defined in PEP-489
            # https://www.python.org/dev/peps/pep-0489/#export-hook-name
            suffix.encode('ascii')
        except UnicodeEncodeError:
            suffix = 'U' + suffix.encode('punycode').replace(b'-', b'_').decode('ascii')

        initfunc_name = "PyInit" + suffix
        if initfunc_name not in ext.export_symbols:
            ext.export_symbols.append(initfunc_name)
        return ext.export_symbols

    def get_libraries(self, ext):
        """Return the list of libraries to link against when building a
        shared extension.  On most platforms, this is just 'ext.libraries';
        on Windows, we add the Python library (eg. python20.dll).
        """
        # The python library is always needed on Windows.  For MSVC, this
        # is redundant, since the library is mentioned in a pragma in
        # pyconfig.h that MSVC groks.  The other Windows compilers all seem
        # to need it mentioned explicitly, though, so that's what we do.
        # Append '_d' to the python import library on debug builds.
        if sys.platform == "win32":
            from distutils._msvccompiler import MSVCCompiler
            if not isinstance(self.compiler, MSVCCompiler):
                template = "python%d%d"
                if self.debug:
                    template = template + '_d'
                pythonlib = (template %
                       (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
                # don't extend ext.libraries, it may be shared with other
                # extensions, it is a reference to the original list
                return ext.libraries + [pythonlib]
        else:
            # On Android only the main executable and LD_PRELOADs are considered
            # to be RTLD_GLOBAL, all the dependencies of the main executable
            # remain RTLD_LOCAL and so the shared libraries must be linked with
            # libpython when python is built with a shared python library (issue
            # bpo-21536).
            # On Cygwin (and if required, other POSIX-like platforms based on
            # Windows like MinGW) it is simply necessary that all symbols in
            # shared libraries are resolved at link time.
            from distutils.sysconfig import get_config_var
            link_libpython = False
            if get_config_var('Py_ENABLE_SHARED'):
                # A native build on an Android device or on Cygwin
                if hasattr(sys, 'getandroidapilevel'):
                    link_libpython = True
                elif sys.platform == 'cygwin':
                    link_libpython = True
                elif '_PYTHON_HOST_PLATFORM' in os.environ:
                    # We are cross-compiling for one of the relevant platforms
                    if get_config_var('ANDROID_API_LEVEL') != 0:
                        link_libpython = True
                    elif get_config_var('MACHDEP') == 'cygwin':
                        link_libpython = True

            if link_libpython:
                ldversion = get_config_var('LDVERSION')
                return ext.libraries + ['python' + ldversion]

        return ext.libraries
install_lib.py000064400000020315150513660100007410 0ustar00"""distutils.command.install_lib

Implements the Distutils 'install_lib' command
(install all Python modules)."""

import os
import importlib.util
import sys

from distutils.core import Command
from distutils.errors import DistutilsOptionError


# Extension for Python source files.
PYTHON_SOURCE_EXTENSION = ".py"

class install_lib(Command):

    description = "install all Python modules (extensions and pure Python)"

    # The byte-compilation options are a tad confusing.  Here are the
    # possible scenarios:
    #   1) no compilation at all (--no-compile --no-optimize)
    #   2) compile .pyc only (--compile --no-optimize; default)
    #   3) compile .pyc and "opt-1" .pyc (--compile --optimize)
    #   4) compile "opt-1" .pyc only (--no-compile --optimize)
    #   5) compile .pyc and "opt-2" .pyc (--compile --optimize-more)
    #   6) compile "opt-2" .pyc only (--no-compile --optimize-more)
    #
    # The UI for this is two options, 'compile' and 'optimize'.
    # 'compile' is strictly boolean, and only decides whether to
    # generate .pyc files.  'optimize' is three-way (0, 1, or 2), and
    # decides both whether to generate .pyc files and what level of
    # optimization to use.

    user_options = [
        ('install-dir=', 'd', "directory to install to"),
        ('build-dir=','b', "build directory (where to install from)"),
        ('force', 'f', "force installation (overwrite existing files)"),
        ('compile', 'c', "compile .py to .pyc [default]"),
        ('no-compile', None, "don't compile .py files"),
        ('optimize=', 'O',
         "also compile with optimization: -O1 for \"python -O\", "
         "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"),
        ('skip-build', None, "skip the build steps"),
        ]

    boolean_options = ['force', 'compile', 'skip-build']
    negative_opt = {'no-compile' : 'compile'}

    def initialize_options(self):
        # let the 'install' command dictate our installation directory
        self.install_dir = None
        self.build_dir = None
        self.force = 0
        self.compile = None
        self.optimize = None
        self.skip_build = None

    def finalize_options(self):
        # Get all the information we need to install pure Python modules
        # from the umbrella 'install' command -- build (source) directory,
        # install (target) directory, and whether to compile .py files.
        self.set_undefined_options('install',
                                   ('build_lib', 'build_dir'),
                                   ('install_lib', 'install_dir'),
                                   ('force', 'force'),
                                   ('compile', 'compile'),
                                   ('optimize', 'optimize'),
                                   ('skip_build', 'skip_build'),
                                  )

        if self.compile is None:
            self.compile = True
        if self.optimize is None:
            self.optimize = False

        if not isinstance(self.optimize, int):
            try:
                self.optimize = int(self.optimize)
                if self.optimize not in (0, 1, 2):
                    raise AssertionError
            except (ValueError, AssertionError):
                raise DistutilsOptionError("optimize must be 0, 1, or 2")

    def run(self):
        # Make sure we have built everything we need first
        self.build()

        # Install everything: simply dump the entire contents of the build
        # directory to the installation directory (that's the beauty of
        # having a build directory!)
        outfiles = self.install()

        # (Optionally) compile .py to .pyc
        if outfiles is not None and self.distribution.has_pure_modules():
            self.byte_compile(outfiles)

    # -- Top-level worker functions ------------------------------------
    # (called from 'run()')

    def build(self):
        if not self.skip_build:
            if self.distribution.has_pure_modules():
                self.run_command('build_py')
            if self.distribution.has_ext_modules():
                self.run_command('build_ext')

    def install(self):
        if os.path.isdir(self.build_dir):
            outfiles = self.copy_tree(self.build_dir, self.install_dir)
        else:
            self.warn("'%s' does not exist -- no Python modules to install" %
                      self.build_dir)
            return
        return outfiles

    def byte_compile(self, files):
        if sys.dont_write_bytecode:
            self.warn('byte-compiling is disabled, skipping.')
            return

        from distutils.util import byte_compile

        # Get the "--root" directory supplied to the "install" command,
        # and use it as a prefix to strip off the purported filename
        # encoded in bytecode files.  This is far from complete, but it
        # should at least generate usable bytecode in RPM distributions.
        install_root = self.get_finalized_command('install').root

        if self.compile:
            byte_compile(files, optimize=0,
                         force=self.force, prefix=install_root,
                         dry_run=self.dry_run)
        if self.optimize > 0:
            byte_compile(files, optimize=self.optimize,
                         force=self.force, prefix=install_root,
                         verbose=self.verbose, dry_run=self.dry_run)


    # -- Utility methods -----------------------------------------------

    def _mutate_outputs(self, has_any, build_cmd, cmd_option, output_dir):
        if not has_any:
            return []

        build_cmd = self.get_finalized_command(build_cmd)
        build_files = build_cmd.get_outputs()
        build_dir = getattr(build_cmd, cmd_option)

        prefix_len = len(build_dir) + len(os.sep)
        outputs = []
        for file in build_files:
            outputs.append(os.path.join(output_dir, file[prefix_len:]))

        return outputs

    def _bytecode_filenames(self, py_filenames):
        bytecode_files = []
        for py_file in py_filenames:
            # Since build_py handles package data installation, the
            # list of outputs can contain more than just .py files.
            # Make sure we only report bytecode for the .py files.
            ext = os.path.splitext(os.path.normcase(py_file))[1]
            if ext != PYTHON_SOURCE_EXTENSION:
                continue
            if self.compile:
                bytecode_files.append(importlib.util.cache_from_source(
                    py_file, optimization=''))
            if self.optimize > 0:
                bytecode_files.append(importlib.util.cache_from_source(
                    py_file, optimization=self.optimize))

        return bytecode_files


    # -- External interface --------------------------------------------
    # (called by outsiders)

    def get_outputs(self):
        """Return the list of files that would be installed if this command
        were actually run.  Not affected by the "dry-run" flag or whether
        modules have actually been built yet.
        """
        pure_outputs = \
            self._mutate_outputs(self.distribution.has_pure_modules(),
                                 'build_py', 'build_lib',
                                 self.install_dir)
        if self.compile:
            bytecode_outputs = self._bytecode_filenames(pure_outputs)
        else:
            bytecode_outputs = []

        ext_outputs = \
            self._mutate_outputs(self.distribution.has_ext_modules(),
                                 'build_ext', 'build_lib',
                                 self.install_dir)

        return pure_outputs + bytecode_outputs + ext_outputs

    def get_inputs(self):
        """Get the list of files that are input to this command, ie. the
        files that get installed as they are named in the build tree.
        The files in this list correspond one-to-one to the output
        filenames returned by 'get_outputs()'.
        """
        inputs = []

        if self.distribution.has_pure_modules():
            build_py = self.get_finalized_command('build_py')
            inputs.extend(build_py.get_outputs())

        if self.distribution.has_ext_modules():
            build_ext = self.get_finalized_command('build_ext')
            inputs.extend(build_ext.get_outputs())

        return inputs
register.py000064400000026700150513660100006744 0ustar00"""distutils.command.register

Implements the Distutils 'register' command (register with the repository).
"""

# created 2002/10/21, Richard Jones

import getpass
import io
import urllib.parse, urllib.request
from warnings import warn

from distutils.core import PyPIRCCommand
from distutils.errors import *
from distutils import log

class register(PyPIRCCommand):

    description = ("register the distribution with the Python package index")
    user_options = PyPIRCCommand.user_options + [
        ('list-classifiers', None,
         'list the valid Trove classifiers'),
        ('strict', None ,
         'Will stop the registering if the meta-data are not fully compliant')
        ]
    boolean_options = PyPIRCCommand.boolean_options + [
        'verify', 'list-classifiers', 'strict']

    sub_commands = [('check', lambda self: True)]

    def initialize_options(self):
        PyPIRCCommand.initialize_options(self)
        self.list_classifiers = 0
        self.strict = 0

    def finalize_options(self):
        PyPIRCCommand.finalize_options(self)
        # setting options for the `check` subcommand
        check_options = {'strict': ('register', self.strict),
                         'restructuredtext': ('register', 1)}
        self.distribution.command_options['check'] = check_options

    def run(self):
        self.finalize_options()
        self._set_config()

        # Run sub commands
        for cmd_name in self.get_sub_commands():
            self.run_command(cmd_name)

        if self.dry_run:
            self.verify_metadata()
        elif self.list_classifiers:
            self.classifiers()
        else:
            self.send_metadata()

    def check_metadata(self):
        """Deprecated API."""
        warn("distutils.command.register.check_metadata is deprecated, \
              use the check command instead", PendingDeprecationWarning)
        check = self.distribution.get_command_obj('check')
        check.ensure_finalized()
        check.strict = self.strict
        check.restructuredtext = 1
        check.run()

    def _set_config(self):
        ''' Reads the configuration file and set attributes.
        '''
        config = self._read_pypirc()
        if config != {}:
            self.username = config['username']
            self.password = config['password']
            self.repository = config['repository']
            self.realm = config['realm']
            self.has_config = True
        else:
            if self.repository not in ('pypi', self.DEFAULT_REPOSITORY):
                raise ValueError('%s not found in .pypirc' % self.repository)
            if self.repository == 'pypi':
                self.repository = self.DEFAULT_REPOSITORY
            self.has_config = False

    def classifiers(self):
        ''' Fetch the list of classifiers from the server.
        '''
        url = self.repository+'?:action=list_classifiers'
        response = urllib.request.urlopen(url)
        log.info(self._read_pypi_response(response))

    def verify_metadata(self):
        ''' Send the metadata to the package index server to be checked.
        '''
        # send the info to the server and report the result
        (code, result) = self.post_to_server(self.build_post_data('verify'))
        log.info('Server response (%s): %s', code, result)

    def send_metadata(self):
        ''' Send the metadata to the package index server.

            Well, do the following:
            1. figure who the user is, and then
            2. send the data as a Basic auth'ed POST.

            First we try to read the username/password from $HOME/.pypirc,
            which is a ConfigParser-formatted file with a section
            [distutils] containing username and password entries (both
            in clear text). Eg:

                [distutils]
                index-servers =
                    pypi

                [pypi]
                username: fred
                password: sekrit

            Otherwise, to figure who the user is, we offer the user three
            choices:

             1. use existing login,
             2. register as a new user, or
             3. set the password to a random string and email the user.

        '''
        # see if we can short-cut and get the username/password from the
        # config
        if self.has_config:
            choice = '1'
            username = self.username
            password = self.password
        else:
            choice = 'x'
            username = password = ''

        # get the user's login info
        choices = '1 2 3 4'.split()
        while choice not in choices:
            self.announce('''\
We need to know who you are, so please choose either:
 1. use your existing login,
 2. register as a new user,
 3. have the server generate a new password for you (and email it to you), or
 4. quit
Your selection [default 1]: ''', log.INFO)
            choice = input()
            if not choice:
                choice = '1'
            elif choice not in choices:
                print('Please choose one of the four options!')

        if choice == '1':
            # get the username and password
            while not username:
                username = input('Username: ')
            while not password:
                password = getpass.getpass('Password: ')

            # set up the authentication
            auth = urllib.request.HTTPPasswordMgr()
            host = urllib.parse.urlparse(self.repository)[1]
            auth.add_password(self.realm, host, username, password)
            # send the info to the server and report the result
            code, result = self.post_to_server(self.build_post_data('submit'),
                auth)
            self.announce('Server response (%s): %s' % (code, result),
                          log.INFO)

            # possibly save the login
            if code == 200:
                if self.has_config:
                    # sharing the password in the distribution instance
                    # so the upload command can reuse it
                    self.distribution.password = password
                else:
                    self.announce(('I can store your PyPI login so future '
                                   'submissions will be faster.'), log.INFO)
                    self.announce('(the login will be stored in %s)' % \
                                  self._get_rc_file(), log.INFO)
                    choice = 'X'
                    while choice.lower() not in 'yn':
                        choice = input('Save your login (y/N)?')
                        if not choice:
                            choice = 'n'
                    if choice.lower() == 'y':
                        self._store_pypirc(username, password)

        elif choice == '2':
            data = {':action': 'user'}
            data['name'] = data['password'] = data['email'] = ''
            data['confirm'] = None
            while not data['name']:
                data['name'] = input('Username: ')
            while data['password'] != data['confirm']:
                while not data['password']:
                    data['password'] = getpass.getpass('Password: ')
                while not data['confirm']:
                    data['confirm'] = getpass.getpass(' Confirm: ')
                if data['password'] != data['confirm']:
                    data['password'] = ''
                    data['confirm'] = None
                    print("Password and confirm don't match!")
            while not data['email']:
                data['email'] = input('   EMail: ')
            code, result = self.post_to_server(data)
            if code != 200:
                log.info('Server response (%s): %s', code, result)
            else:
                log.info('You will receive an email shortly.')
                log.info(('Follow the instructions in it to '
                          'complete registration.'))
        elif choice == '3':
            data = {':action': 'password_reset'}
            data['email'] = ''
            while not data['email']:
                data['email'] = input('Your email address: ')
            code, result = self.post_to_server(data)
            log.info('Server response (%s): %s', code, result)

    def build_post_data(self, action):
        # figure the data to send - the metadata plus some additional
        # information used by the package server
        meta = self.distribution.metadata
        data = {
            ':action': action,
            'metadata_version' : '1.0',
            'name': meta.get_name(),
            'version': meta.get_version(),
            'summary': meta.get_description(),
            'home_page': meta.get_url(),
            'author': meta.get_contact(),
            'author_email': meta.get_contact_email(),
            'license': meta.get_licence(),
            'description': meta.get_long_description(),
            'keywords': meta.get_keywords(),
            'platform': meta.get_platforms(),
            'classifiers': meta.get_classifiers(),
            'download_url': meta.get_download_url(),
            # PEP 314
            'provides': meta.get_provides(),
            'requires': meta.get_requires(),
            'obsoletes': meta.get_obsoletes(),
        }
        if data['provides'] or data['requires'] or data['obsoletes']:
            data['metadata_version'] = '1.1'
        return data

    def post_to_server(self, data, auth=None):
        ''' Post a query to the server, and return a string response.
        '''
        if 'name' in data:
            self.announce('Registering %s to %s' % (data['name'],
                                                    self.repository),
                                                    log.INFO)
        # Build up the MIME payload for the urllib2 POST data
        boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
        sep_boundary = '\n--' + boundary
        end_boundary = sep_boundary + '--'
        body = io.StringIO()
        for key, value in data.items():
            # handle multiple entries for the same name
            if type(value) not in (type([]), type( () )):
                value = [value]
            for value in value:
                value = str(value)
                body.write(sep_boundary)
                body.write('\nContent-Disposition: form-data; name="%s"'%key)
                body.write("\n\n")
                body.write(value)
                if value and value[-1] == '\r':
                    body.write('\n')  # write an extra newline (lurve Macs)
        body.write(end_boundary)
        body.write("\n")
        body = body.getvalue().encode("utf-8")

        # build the Request
        headers = {
            'Content-type': 'multipart/form-data; boundary=%s; charset=utf-8'%boundary,
            'Content-length': str(len(body))
        }
        req = urllib.request.Request(self.repository, body, headers)

        # handle HTTP and include the Basic Auth handler
        opener = urllib.request.build_opener(
            urllib.request.HTTPBasicAuthHandler(password_mgr=auth)
        )
        data = ''
        try:
            result = opener.open(req)
        except urllib.error.HTTPError as e:
            if self.show_response:
                data = e.fp.read()
            result = e.code, e.msg
        except urllib.error.URLError as e:
            result = 500, str(e)
        else:
            if self.show_response:
                data = self._read_pypi_response(result)
            result = 200, 'OK'
        if self.show_response:
            msg = '\n'.join(('-' * 75, data, '-' * 75))
            self.announce(msg, log.INFO)
        return result
check.py000064400000012737150513660100006202 0ustar00"""distutils.command.check

Implements the Distutils 'check' command.
"""
from distutils.core import Command
from distutils.errors import DistutilsSetupError

try:
    # docutils is installed
    from docutils.utils import Reporter
    from docutils.parsers.rst import Parser
    from docutils import frontend
    from docutils import nodes
    from io import StringIO

    class SilentReporter(Reporter):

        def __init__(self, source, report_level, halt_level, stream=None,
                     debug=0, encoding='ascii', error_handler='replace'):
            self.messages = []
            Reporter.__init__(self, source, report_level, halt_level, stream,
                              debug, encoding, error_handler)

        def system_message(self, level, message, *children, **kwargs):
            self.messages.append((level, message, children, kwargs))
            return nodes.system_message(message, level=level,
                                        type=self.levels[level],
                                        *children, **kwargs)

    HAS_DOCUTILS = True
except Exception:
    # Catch all exceptions because exceptions besides ImportError probably
    # indicate that docutils is not ported to Py3k.
    HAS_DOCUTILS = False

class check(Command):
    """This command checks the meta-data of the package.
    """
    description = ("perform some checks on the package")
    user_options = [('metadata', 'm', 'Verify meta-data'),
                    ('restructuredtext', 'r',
                     ('Checks if long string meta-data syntax '
                      'are reStructuredText-compliant')),
                    ('strict', 's',
                     'Will exit with an error if a check fails')]

    boolean_options = ['metadata', 'restructuredtext', 'strict']

    def initialize_options(self):
        """Sets default values for options."""
        self.restructuredtext = 0
        self.metadata = 1
        self.strict = 0
        self._warnings = 0

    def finalize_options(self):
        pass

    def warn(self, msg):
        """Counts the number of warnings that occurs."""
        self._warnings += 1
        return Command.warn(self, msg)

    def run(self):
        """Runs the command."""
        # perform the various tests
        if self.metadata:
            self.check_metadata()
        if self.restructuredtext:
            if HAS_DOCUTILS:
                self.check_restructuredtext()
            elif self.strict:
                raise DistutilsSetupError('The docutils package is needed.')

        # let's raise an error in strict mode, if we have at least
        # one warning
        if self.strict and self._warnings > 0:
            raise DistutilsSetupError('Please correct your package.')

    def check_metadata(self):
        """Ensures that all required elements of meta-data are supplied.

        name, version, URL, (author and author_email) or
        (maintainer and maintainer_email)).

        Warns if any are missing.
        """
        metadata = self.distribution.metadata

        missing = []
        for attr in ('name', 'version', 'url'):
            if not (hasattr(metadata, attr) and getattr(metadata, attr)):
                missing.append(attr)

        if missing:
            self.warn("missing required meta-data: %s"  % ', '.join(missing))
        if metadata.author:
            if not metadata.author_email:
                self.warn("missing meta-data: if 'author' supplied, " +
                          "'author_email' must be supplied too")
        elif metadata.maintainer:
            if not metadata.maintainer_email:
                self.warn("missing meta-data: if 'maintainer' supplied, " +
                          "'maintainer_email' must be supplied too")
        else:
            self.warn("missing meta-data: either (author and author_email) " +
                      "or (maintainer and maintainer_email) " +
                      "must be supplied")

    def check_restructuredtext(self):
        """Checks if the long string fields are reST-compliant."""
        data = self.distribution.get_long_description()
        for warning in self._check_rst_data(data):
            line = warning[-1].get('line')
            if line is None:
                warning = warning[1]
            else:
                warning = '%s (line %s)' % (warning[1], line)
            self.warn(warning)

    def _check_rst_data(self, data):
        """Returns warnings when the provided data doesn't compile."""
        # the include and csv_table directives need this to be a path
        source_path = self.distribution.script_name or 'setup.py'
        parser = Parser()
        settings = frontend.OptionParser(components=(Parser,)).get_default_values()
        settings.tab_width = 4
        settings.pep_references = None
        settings.rfc_references = None
        reporter = SilentReporter(source_path,
                          settings.report_level,
                          settings.halt_level,
                          stream=settings.warning_stream,
                          debug=settings.debug,
                          encoding=settings.error_encoding,
                          error_handler=settings.error_encoding_error_handler)

        document = nodes.document(settings, reporter, source=source_path)
        document.note_source(source_path, -1)
        try:
            parser.parse(data, document)
        except AttributeError as e:
            reporter.messages.append(
                (-1, 'Could not finish the parsing: %s.' % e, '', {}))

        return reporter.messages
build.py000064400000013207150513660100006215 0ustar00"""distutils.command.build

Implements the Distutils 'build' command."""

import sys, os
from distutils.core import Command
from distutils.errors import DistutilsOptionError
from distutils.util import get_platform


def show_compilers():
    from distutils.ccompiler import show_compilers
    show_compilers()


class build(Command):

    description = "build everything needed to install"

    user_options = [
        ('build-base=', 'b',
         "base directory for build library"),
        ('build-purelib=', None,
         "build directory for platform-neutral distributions"),
        ('build-platlib=', None,
         "build directory for platform-specific distributions"),
        ('build-lib=', None,
         "build directory for all distribution (defaults to either " +
         "build-purelib or build-platlib"),
        ('build-scripts=', None,
         "build directory for scripts"),
        ('build-temp=', 't',
         "temporary build directory"),
        ('plat-name=', 'p',
         "platform name to build for, if supported "
         "(default: %s)" % get_platform()),
        ('compiler=', 'c',
         "specify the compiler type"),
        ('parallel=', 'j',
         "number of parallel build jobs"),
        ('debug', 'g',
         "compile extensions and libraries with debugging information"),
        ('force', 'f',
         "forcibly build everything (ignore file timestamps)"),
        ('executable=', 'e',
         "specify final destination interpreter path (build.py)"),
        ]

    boolean_options = ['debug', 'force']

    help_options = [
        ('help-compiler', None,
         "list available compilers", show_compilers),
        ]

    def initialize_options(self):
        self.build_base = 'build'
        # these are decided only after 'build_base' has its final value
        # (unless overridden by the user or client)
        self.build_purelib = None
        self.build_platlib = None
        self.build_lib = None
        self.build_temp = None
        self.build_scripts = None
        self.compiler = None
        self.plat_name = None
        self.debug = None
        self.force = 0
        self.executable = None
        self.parallel = None

    def finalize_options(self):
        if self.plat_name is None:
            self.plat_name = get_platform()
        else:
            # plat-name only supported for windows (other platforms are
            # supported via ./configure flags, if at all).  Avoid misleading
            # other platforms.
            if os.name != 'nt':
                raise DistutilsOptionError(
                            "--plat-name only supported on Windows (try "
                            "using './configure --help' on your platform)")

        plat_specifier = ".%s-%d.%d" % (self.plat_name, *sys.version_info[:2])

        # Make it so Python 2.x and Python 2.x with --with-pydebug don't
        # share the same build directories. Doing so confuses the build
        # process for C modules
        if hasattr(sys, 'gettotalrefcount'):
            plat_specifier += '-pydebug'

        # 'build_purelib' and 'build_platlib' just default to 'lib' and
        # 'lib.<plat>' under the base build directory.  We only use one of
        # them for a given distribution, though --
        if self.build_purelib is None:
            self.build_purelib = os.path.join(self.build_base, 'lib')
        if self.build_platlib is None:
            self.build_platlib = os.path.join(self.build_base,
                                              'lib' + plat_specifier)

        # 'build_lib' is the actual directory that we will use for this
        # particular module distribution -- if user didn't supply it, pick
        # one of 'build_purelib' or 'build_platlib'.
        if self.build_lib is None:
            if self.distribution.ext_modules:
                self.build_lib = self.build_platlib
            else:
                self.build_lib = self.build_purelib

        # 'build_temp' -- temporary directory for compiler turds,
        # "build/temp.<plat>"
        if self.build_temp is None:
            self.build_temp = os.path.join(self.build_base,
                                           'temp' + plat_specifier)
        if self.build_scripts is None:
            self.build_scripts = os.path.join(self.build_base,
                                              'scripts-%d.%d' % sys.version_info[:2])

        if self.executable is None and sys.executable:
            self.executable = os.path.normpath(sys.executable)

        if isinstance(self.parallel, str):
            try:
                self.parallel = int(self.parallel)
            except ValueError:
                raise DistutilsOptionError("parallel should be an integer")

    def run(self):
        # Run all relevant sub-commands.  This will be some subset of:
        #  - build_py      - pure Python modules
        #  - build_clib    - standalone C libraries
        #  - build_ext     - Python extensions
        #  - build_scripts - (Python) scripts
        for cmd_name in self.get_sub_commands():
            self.run_command(cmd_name)


    # -- Predicates for the sub-command list ---------------------------

    def has_pure_modules(self):
        return self.distribution.has_pure_modules()

    def has_c_libraries(self):
        return self.distribution.has_c_libraries()

    def has_ext_modules(self):
        return self.distribution.has_ext_modules()

    def has_scripts(self):
        return self.distribution.has_scripts()


    sub_commands = [('build_py',      has_pure_modules),
                    ('build_clib',    has_c_libraries),
                    ('build_ext',     has_ext_modules),
                    ('build_scripts', has_scripts),
                   ]
build_clib.py000064400000017526150513660100007216 0ustar00"""distutils.command.build_clib

Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module."""


# XXX this module has *lots* of code ripped-off quite transparently from
# build_ext.py -- not surprisingly really, as the work required to build
# a static library from a collection of C source files is not really all
# that different from what's required to build a shared object file from
# a collection of C source files.  Nevertheless, I haven't done the
# necessary refactoring to account for the overlap in code between the
# two modules, mainly because a number of subtle details changed in the
# cut 'n paste.  Sigh.

import os
from distutils.core import Command
from distutils.errors import *
from distutils.sysconfig import customize_compiler
from distutils import log

def show_compilers():
    from distutils.ccompiler import show_compilers
    show_compilers()


class build_clib(Command):

    description = "build C/C++ libraries used by Python extensions"

    user_options = [
        ('build-clib=', 'b',
         "directory to build C/C++ libraries to"),
        ('build-temp=', 't',
         "directory to put temporary build by-products"),
        ('debug', 'g',
         "compile with debugging information"),
        ('force', 'f',
         "forcibly build everything (ignore file timestamps)"),
        ('compiler=', 'c',
         "specify the compiler type"),
        ]

    boolean_options = ['debug', 'force']

    help_options = [
        ('help-compiler', None,
         "list available compilers", show_compilers),
        ]

    def initialize_options(self):
        self.build_clib = None
        self.build_temp = None

        # List of libraries to build
        self.libraries = None

        # Compilation options for all libraries
        self.include_dirs = None
        self.define = None
        self.undef = None
        self.debug = None
        self.force = 0
        self.compiler = None


    def finalize_options(self):
        # This might be confusing: both build-clib and build-temp default
        # to build-temp as defined by the "build" command.  This is because
        # I think that C libraries are really just temporary build
        # by-products, at least from the point of view of building Python
        # extensions -- but I want to keep my options open.
        self.set_undefined_options('build',
                                   ('build_temp', 'build_clib'),
                                   ('build_temp', 'build_temp'),
                                   ('compiler', 'compiler'),
                                   ('debug', 'debug'),
                                   ('force', 'force'))

        self.libraries = self.distribution.libraries
        if self.libraries:
            self.check_library_list(self.libraries)

        if self.include_dirs is None:
            self.include_dirs = self.distribution.include_dirs or []
        if isinstance(self.include_dirs, str):
            self.include_dirs = self.include_dirs.split(os.pathsep)

        # XXX same as for build_ext -- what about 'self.define' and
        # 'self.undef' ?


    def run(self):
        if not self.libraries:
            return

        # Yech -- this is cut 'n pasted from build_ext.py!
        from distutils.ccompiler import new_compiler
        self.compiler = new_compiler(compiler=self.compiler,
                                     dry_run=self.dry_run,
                                     force=self.force)
        customize_compiler(self.compiler)

        if self.include_dirs is not None:
            self.compiler.set_include_dirs(self.include_dirs)
        if self.define is not None:
            # 'define' option is a list of (name,value) tuples
            for (name,value) in self.define:
                self.compiler.define_macro(name, value)
        if self.undef is not None:
            for macro in self.undef:
                self.compiler.undefine_macro(macro)

        self.build_libraries(self.libraries)


    def check_library_list(self, libraries):
        """Ensure that the list of libraries is valid.

        `library` is presumably provided as a command option 'libraries'.
        This method checks that it is a list of 2-tuples, where the tuples
        are (library_name, build_info_dict).

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        """
        if not isinstance(libraries, list):
            raise DistutilsSetupError(
                  "'libraries' option must be a list of tuples")

        for lib in libraries:
            if not isinstance(lib, tuple) and len(lib) != 2:
                raise DistutilsSetupError(
                      "each element of 'libraries' must a 2-tuple")

            name, build_info = lib

            if not isinstance(name, str):
                raise DistutilsSetupError(
                      "first element of each tuple in 'libraries' "
                      "must be a string (the library name)")

            if '/' in name or (os.sep != '/' and os.sep in name):
                raise DistutilsSetupError("bad library name '%s': "
                       "may not contain directory separators" % lib[0])

            if not isinstance(build_info, dict):
                raise DistutilsSetupError(
                      "second element of each tuple in 'libraries' "
                      "must be a dictionary (build info)")


    def get_library_names(self):
        # Assume the library list is valid -- 'check_library_list()' is
        # called from 'finalize_options()', so it should be!
        if not self.libraries:
            return None

        lib_names = []
        for (lib_name, build_info) in self.libraries:
            lib_names.append(lib_name)
        return lib_names


    def get_source_files(self):
        self.check_library_list(self.libraries)
        filenames = []
        for (lib_name, build_info) in self.libraries:
            sources = build_info.get('sources')
            if sources is None or not isinstance(sources, (list, tuple)):
                raise DistutilsSetupError(
                       "in 'libraries' option (library '%s'), "
                       "'sources' must be present and must be "
                       "a list of source filenames" % lib_name)

            filenames.extend(sources)
        return filenames


    def build_libraries(self, libraries):
        for (lib_name, build_info) in libraries:
            sources = build_info.get('sources')
            if sources is None or not isinstance(sources, (list, tuple)):
                raise DistutilsSetupError(
                       "in 'libraries' option (library '%s'), "
                       "'sources' must be present and must be "
                       "a list of source filenames" % lib_name)
            sources = list(sources)

            log.info("building '%s' library", lib_name)

            # First, compile the source code to object files in the library
            # directory.  (This should probably change to putting object
            # files in a temporary build directory.)
            macros = build_info.get('macros')
            include_dirs = build_info.get('include_dirs')
            objects = self.compiler.compile(sources,
                                            output_dir=self.build_temp,
                                            macros=macros,
                                            include_dirs=include_dirs,
                                            debug=self.debug)

            # Now "link" the object files together into a static library.
            # (On Unix at least, this isn't really linking -- it just
            # builds an archive.  Whatever.)
            self.compiler.create_static_lib(objects, lib_name,
                                            output_dir=self.build_clib,
                                            debug=self.debug)
install_data.py000064400000005406150513660100007557 0ustar00"""distutils.command.install_data

Implements the Distutils 'install_data' command, for installing
platform-independent data files."""

# contributed by Bastian Kleineidam

import os
from distutils.core import Command
from distutils.util import change_root, convert_path

class install_data(Command):

    description = "install data files"

    user_options = [
        ('install-dir=', 'd',
         "base directory for installing data files "
         "(default: installation base dir)"),
        ('root=', None,
         "install everything relative to this alternate root directory"),
        ('force', 'f', "force installation (overwrite existing files)"),
        ]

    boolean_options = ['force']

    def initialize_options(self):
        self.install_dir = None
        self.outfiles = []
        self.root = None
        self.force = 0
        self.data_files = self.distribution.data_files
        self.warn_dir = 1

    def finalize_options(self):
        self.set_undefined_options('install',
                                   ('install_data', 'install_dir'),
                                   ('root', 'root'),
                                   ('force', 'force'),
                                  )

    def run(self):
        self.mkpath(self.install_dir)
        for f in self.data_files:
            if isinstance(f, str):
                # it's a simple file, so copy it
                f = convert_path(f)
                if self.warn_dir:
                    self.warn("setup script did not provide a directory for "
                              "'%s' -- installing right in '%s'" %
                              (f, self.install_dir))
                (out, _) = self.copy_file(f, self.install_dir)
                self.outfiles.append(out)
            else:
                # it's a tuple with path to install to and a list of files
                dir = convert_path(f[0])
                if not os.path.isabs(dir):
                    dir = os.path.join(self.install_dir, dir)
                elif self.root:
                    dir = change_root(self.root, dir)
                self.mkpath(dir)

                if f[1] == []:
                    # If there are no files listed, the user must be
                    # trying to create an empty directory, so add the
                    # directory to the list of output files.
                    self.outfiles.append(dir)
                else:
                    # Copy files, adding them to the list of output files.
                    for data in f[1]:
                        data = convert_path(data)
                        (out, _) = self.copy_file(data, dir)
                        self.outfiles.append(out)

    def get_inputs(self):
        return self.data_files or []

    def get_outputs(self):
        return self.outfiles