404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@13.59.88.8: ~ $
from distutils import log
import distutils.command.sdist as orig
import os
import sys
import io
import contextlib

from setuptools.extern import six

from .py36compat import sdist_add_defaults

import pkg_resources

_default_revctrl = list


def walk_revctrl(dirname=''):
    """Find all files under revision control"""
    for ep in pkg_resources.iter_entry_points('setuptools.file_finders'):
        for item in ep.load()(dirname):
            yield item


class sdist(sdist_add_defaults, orig.sdist):
    """Smart sdist that finds anything supported by revision control"""

    user_options = [
        ('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]"),
    ]

    negative_opt = {}

    README_EXTENSIONS = ['', '.rst', '.txt', '.md']
    READMES = tuple('README{0}'.format(ext) for ext in README_EXTENSIONS)

    def run(self):
        self.run_command('egg_info')
        ei_cmd = self.get_finalized_command('egg_info')
        self.filelist = ei_cmd.filelist
        self.filelist.append(os.path.join(ei_cmd.egg_info, 'SOURCES.txt'))
        self.check_readme()

        # Run sub commands
        for cmd_name in self.get_sub_commands():
            self.run_command(cmd_name)

        self.make_distribution()

        dist_files = getattr(self.distribution, 'dist_files', [])
        for file in self.archive_files:
            data = ('sdist', '', file)
            if data not in dist_files:
                dist_files.append(data)

    def initialize_options(self):
        orig.sdist.initialize_options(self)

        self._default_to_gztar()

    def _default_to_gztar(self):
        # only needed on Python prior to 3.6.
        if sys.version_info >= (3, 6, 0, 'beta', 1):
            return
        self.formats = ['gztar']

    def make_distribution(self):
        """
        Workaround for #516
        """
        with self._remove_os_link():
            orig.sdist.make_distribution(self)

    @staticmethod
    @contextlib.contextmanager
    def _remove_os_link():
        """
        In a context, remove and restore os.link if it exists
        """

        class NoValue:
            pass

        orig_val = getattr(os, 'link', NoValue)
        try:
            del os.link
        except Exception:
            pass
        try:
            yield
        finally:
            if orig_val is not NoValue:
                setattr(os, 'link', orig_val)

    def __read_template_hack(self):
        # This grody hack closes the template file (MANIFEST.in) if an
        #  exception occurs during read_template.
        # Doing so prevents an error when easy_install attempts to delete the
        #  file.
        try:
            orig.sdist.read_template(self)
        except Exception:
            _, _, tb = sys.exc_info()
            tb.tb_next.tb_frame.f_locals['template'].close()
            raise

    # Beginning with Python 2.7.2, 3.1.4, and 3.2.1, this leaky file handle
    #  has been fixed, so only override the method if we're using an earlier
    #  Python.
    has_leaky_handle = (
        sys.version_info < (2, 7, 2)
        or (3, 0) <= sys.version_info < (3, 1, 4)
        or (3, 2) <= sys.version_info < (3, 2, 1)
    )
    if has_leaky_handle:
        read_template = __read_template_hack

    def _add_defaults_python(self):
        """getting python files"""
        if self.distribution.has_pure_modules():
            build_py = self.get_finalized_command('build_py')
            self.filelist.extend(build_py.get_source_files())
            # This functionality is incompatible with include_package_data, and
            # will in fact create an infinite recursion if include_package_data
            # is True.  Use of include_package_data will imply that
            # distutils-style automatic handling of package_data is disabled
            if not self.distribution.include_package_data:
                for _, src_dir, _, filenames in build_py.data_files:
                    self.filelist.extend([os.path.join(src_dir, filename)
                                          for filename in filenames])

    def _add_defaults_data_files(self):
        try:
            if six.PY2:
                sdist_add_defaults._add_defaults_data_files(self)
            else:
                super()._add_defaults_data_files()
        except TypeError:
            log.warn("data_files contains unexpected objects")

    def check_readme(self):
        for f in self.READMES:
            if os.path.exists(f):
                return
        else:
            self.warn(
                "standard file not found: should have one of " +
                ', '.join(self.READMES)
            )

    def make_release_tree(self, base_dir, files):
        orig.sdist.make_release_tree(self, base_dir, files)

        # Save any egg_info command line options used to create this sdist
        dest = os.path.join(base_dir, 'setup.cfg')
        if hasattr(os, 'link') and os.path.exists(dest):
            # unlink and re-copy, since it might be hard-linked, and
            # we don't want to change the source version
            os.unlink(dest)
            self.copy_file('setup.cfg', dest)

        self.get_finalized_command('egg_info').save_version_info(dest)

    def _manifest_is_not_generated(self):
        # check for special comment used in 2.7.1 and higher
        if not os.path.isfile(self.manifest):
            return False

        with io.open(self.manifest, 'rb') as fp:
            first_line = fp.readline()
        return (first_line !=
                '# file GENERATED by distutils, do NOT edit\n'.encode())

    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)
        manifest = open(self.manifest, 'rb')
        for line in manifest:
            # The manifest must contain UTF-8. See #303.
            if six.PY3:
                try:
                    line = line.decode('UTF-8')
                except UnicodeDecodeError:
                    log.warn("%r not UTF-8 decodable -- skipping" % line)
                    continue
            # ignore comments and blank lines
            line = line.strip()
            if line.startswith('#') or not line:
                continue
            self.filelist.append(line)
        manifest.close()

Filemanager

Name Type Size Permission Actions
__init__.py File 594 B 0644
__init__.pyc File 882 B 0644
__init__.pyo File 882 B 0644
alias.py File 2.37 KB 0644
alias.pyc File 3.03 KB 0644
alias.pyo File 3.03 KB 0644
bdist_egg.py File 17.76 KB 0644
bdist_egg.pyc File 17.96 KB 0644
bdist_egg.pyo File 17.96 KB 0644
bdist_rpm.py File 1.47 KB 0644
bdist_rpm.pyc File 1.87 KB 0644
bdist_rpm.pyo File 1.87 KB 0644
bdist_wininst.py File 637 B 0644
bdist_wininst.pyc File 1.16 KB 0644
bdist_wininst.pyo File 1.16 KB 0644
build_clib.py File 4.38 KB 0644
build_clib.pyc File 2.78 KB 0644
build_clib.pyo File 2.78 KB 0644
build_ext.py File 12.86 KB 0644
build_ext.pyc File 12.28 KB 0644
build_ext.pyo File 12.23 KB 0644
build_py.py File 9.37 KB 0644
build_py.pyc File 10.42 KB 0644
build_py.pyo File 10.42 KB 0644
develop.py File 7.86 KB 0644
develop.pyc File 7.71 KB 0644
develop.pyo File 7.71 KB 0644
dist_info.py File 960 B 0644
dist_info.pyc File 1.76 KB 0644
dist_info.pyo File 1.76 KB 0644
easy_install.py File 84.99 KB 0644
easy_install.pyc File 78.5 KB 0644
easy_install.pyo File 78.44 KB 0644
egg_info.py File 24.22 KB 0644
egg_info.pyc File 25.29 KB 0644
egg_info.pyo File 25.29 KB 0644
install.py File 4.57 KB 0644
install.pyc File 4.84 KB 0644
install.pyo File 4.84 KB 0644
install_egg_info.py File 2.15 KB 0644
install_egg_info.pyc File 3.11 KB 0644
install_egg_info.pyo File 3.11 KB 0644
install_lib.py File 3.75 KB 0644
install_lib.pyc File 4.76 KB 0644
install_lib.pyo File 4.71 KB 0644
install_scripts.py File 2.38 KB 0644
install_scripts.pyc File 2.82 KB 0644
install_scripts.pyo File 2.82 KB 0644
launcher manifest.xml File 628 B 0644
py36compat.py File 4.87 KB 0644
py36compat.pyc File 5.42 KB 0644
py36compat.pyo File 5.42 KB 0644
register.py File 270 B 0644
register.pyc File 710 B 0644
register.pyo File 710 B 0644
rotate.py File 2.11 KB 0644
rotate.pyc File 2.96 KB 0644
rotate.pyo File 2.96 KB 0644
saveopts.py File 658 B 0644
saveopts.pyc File 1.1 KB 0644
saveopts.pyo File 1.1 KB 0644
sdist.py File 6.55 KB 0644
sdist.pyc File 7.64 KB 0644
sdist.pyo File 7.64 KB 0644
setopt.py File 4.97 KB 0644
setopt.pyc File 5.91 KB 0644
setopt.pyo File 5.91 KB 0644
test.py File 9 KB 0644
test.pyc File 10.22 KB 0644
test.pyo File 10.22 KB 0644
upload.py File 1.14 KB 0644
upload.pyc File 1.6 KB 0644
upload.pyo File 1.6 KB 0644
upload_docs.py File 7.14 KB 0644
upload_docs.pyc File 7.66 KB 0644
upload_docs.pyo File 7.63 KB 0644