SILENT KILLERPanel

Current Path: > > lib > python2.7 > site-packages > pip > > > >


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //lib/python2.7/site-packages/pip////

NameTypeSizeLast ModifiedActions
_vendor Directory - -
commands Directory - -
compat Directory - -
models Directory - -
operations Directory - -
req Directory - -
utils Directory - -
vcs Directory - -
__init__.py File 11934 bytes April 21 2022 18:08:21.
__init__.pyc File 9575 bytes April 21 2022 18:08:34.
__init__.pyo File 9392 bytes April 21 2022 18:08:35.
__main__.py File 584 bytes April 21 2022 18:08:21.
__main__.pyc File 484 bytes April 21 2022 18:08:34.
__main__.pyo File 484 bytes April 21 2022 18:08:34.
basecommand.py File 11910 bytes April 21 2022 18:08:21.
basecommand.pyc File 8935 bytes April 21 2022 18:08:35.
basecommand.pyo File 8935 bytes April 21 2022 18:08:35.
baseparser.py File 10465 bytes April 21 2022 18:08:21.
baseparser.pyc File 10745 bytes April 21 2022 18:08:35.
baseparser.pyo File 10709 bytes April 21 2022 18:08:36.
cmdoptions.py File 16474 bytes April 21 2022 18:08:21.
cmdoptions.pyc File 15626 bytes April 21 2022 18:08:35.
cmdoptions.pyo File 15626 bytes April 21 2022 18:08:35.
download.py File 32847 bytes April 21 2022 18:08:21.
download.pyc File 25940 bytes April 21 2022 18:08:35.
download.pyo File 25814 bytes April 21 2022 18:08:36.
exceptions.py File 8121 bytes April 21 2022 18:08:21.
exceptions.pyc File 12448 bytes April 21 2022 18:08:35.
exceptions.pyo File 12448 bytes April 21 2022 18:08:35.
index.py File 39950 bytes April 21 2022 18:08:21.
index.pyc File 35141 bytes April 21 2022 18:08:35.
index.pyo File 35063 bytes April 21 2022 18:08:36.
locations.py File 5626 bytes April 21 2022 18:08:21.
locations.pyc File 4769 bytes April 21 2022 18:08:35.
locations.pyo File 4676 bytes April 21 2022 18:08:36.
pep425tags.py File 10980 bytes April 21 2022 18:08:21.
pep425tags.pyc File 9479 bytes April 21 2022 18:08:35.
pep425tags.pyo File 9479 bytes April 21 2022 18:08:35.
status_codes.py File 156 bytes April 21 2022 18:08:21.
status_codes.pyc File 393 bytes April 21 2022 18:08:35.
status_codes.pyo File 393 bytes April 21 2022 18:08:35.
wheel.py File 32287 bytes April 21 2022 18:08:21.
wheel.pyc File 25433 bytes April 21 2022 18:08:35.
wheel.pyo File 25218 bytes April 21 2022 18:08:36.

Reading File: //lib/python2.7/site-packages/pip/////exceptions.py

"""Exceptions used throughout package"""
from __future__ import absolute_import

from itertools import chain, groupby, repeat

from pip._vendor.six import iteritems


class PipError(Exception):
    """Base pip exception"""


class InstallationError(PipError):
    """General exception during installation"""


class UninstallationError(PipError):
    """General exception during uninstallation"""


class DistributionNotFound(InstallationError):
    """Raised when a distribution cannot be found to satisfy a requirement"""


class RequirementsFileParseError(InstallationError):
    """Raised when a general error occurs parsing a requirements file line."""


class BestVersionAlreadyInstalled(PipError):
    """Raised when the most up-to-date version of a package is already
    installed."""


class BadCommand(PipError):
    """Raised when virtualenv or a command is not found"""


class CommandError(PipError):
    """Raised when there is an error in command-line arguments"""


class PreviousBuildDirError(PipError):
    """Raised when there's a previous conflicting build directory"""


class InvalidWheelFilename(InstallationError):
    """Invalid wheel filename."""


class UnsupportedWheel(InstallationError):
    """Unsupported wheel."""


class HashErrors(InstallationError):
    """Multiple HashError instances rolled into one for reporting"""

    def __init__(self):
        self.errors = []

    def append(self, error):
        self.errors.append(error)

    def __str__(self):
        lines = []
        self.errors.sort(key=lambda e: e.order)
        for cls, errors_of_cls in groupby(self.errors, lambda e: e.__class__):
            lines.append(cls.head)
            lines.extend(e.body() for e in errors_of_cls)
        if lines:
            return '\n'.join(lines)

    def __nonzero__(self):
        return bool(self.errors)

    def __bool__(self):
        return self.__nonzero__()


class HashError(InstallationError):
    """
    A failure to verify a package against known-good hashes

    :cvar order: An int sorting hash exception classes by difficulty of
        recovery (lower being harder), so the user doesn't bother fretting
        about unpinned packages when he has deeper issues, like VCS
        dependencies, to deal with. Also keeps error reports in a
        deterministic order.
    :cvar head: A section heading for display above potentially many
        exceptions of this kind
    :ivar req: The InstallRequirement that triggered this error. This is
        pasted on after the exception is instantiated, because it's not
        typically available earlier.

    """
    req = None
    head = ''

    def body(self):
        """Return a summary of me for display under the heading.

        This default implementation simply prints a description of the
        triggering requirement.

        :param req: The InstallRequirement that provoked this error, with
            populate_link() having already been called

        """
        return '    %s' % self._requirement_name()

    def __str__(self):
        return '%s\n%s' % (self.head, self.body())

    def _requirement_name(self):
        """Return a description of the requirement that triggered me.

        This default implementation returns long description of the req, with
        line numbers

        """
        return str(self.req) if self.req else 'unknown package'


class VcsHashUnsupported(HashError):
    """A hash was provided for a version-control-system-based requirement, but
    we don't have a method for hashing those."""

    order = 0
    head = ("Can't verify hashes for these requirements because we don't "
            "have a way to hash version control repositories:")


class DirectoryUrlHashUnsupported(HashError):
    """A hash was provided for a version-control-system-based requirement, but
    we don't have a method for hashing those."""

    order = 1
    head = ("Can't verify hashes for these file:// requirements because they "
            "point to directories:")


class HashMissing(HashError):
    """A hash was needed for a requirement but is absent."""

    order = 2
    head = ('Hashes are required in --require-hashes mode, but they are '
            'missing from some requirements. Here is a list of those '
            'requirements along with the hashes their downloaded archives '
            'actually had. Add lines like these to your requirements files to '
            'prevent tampering. (If you did not enable --require-hashes '
            'manually, note that it turns on automatically when any package '
            'has a hash.)')

    def __init__(self, gotten_hash):
        """
        :param gotten_hash: The hash of the (possibly malicious) archive we
            just downloaded
        """
        self.gotten_hash = gotten_hash

    def body(self):
        from pip.utils.hashes import FAVORITE_HASH  # Dodge circular import.

        package = None
        if self.req:
            # In the case of URL-based requirements, display the original URL
            # seen in the requirements file rather than the package name,
            # so the output can be directly copied into the requirements file.
            package = (self.req.original_link if self.req.original_link
                       # In case someone feeds something downright stupid
                       # to InstallRequirement's constructor.
                       else getattr(self.req, 'req', None))
        return '    %s --hash=%s:%s' % (package or 'unknown package',
                                        FAVORITE_HASH,
                                        self.gotten_hash)


class HashUnpinned(HashError):
    """A requirement had a hash specified but was not pinned to a specific
    version."""

    order = 3
    head = ('In --require-hashes mode, all requirements must have their '
            'versions pinned with ==. These do not:')


class HashMismatch(HashError):
    """
    Distribution file hash values don't match.

    :ivar package_name: The name of the package that triggered the hash
        mismatch. Feel free to write to this after the exception is raise to
        improve its error message.

    """
    order = 4
    head = ('THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS '
            'FILE. If you have updated the package versions, please update '
            'the hashes. Otherwise, examine the package contents carefully; '
            'someone may have tampered with them.')

    def __init__(self, allowed, gots):
        """
        :param allowed: A dict of algorithm names pointing to lists of allowed
            hex digests
        :param gots: A dict of algorithm names pointing to hashes we
            actually got from the files under suspicion
        """
        self.allowed = allowed
        self.gots = gots

    def body(self):
        return '    %s:\n%s' % (self._requirement_name(),
                                self._hash_comparison())

    def _hash_comparison(self):
        """
        Return a comparison of actual and expected hash values.

        Example::

               Expected sha256 abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde
                            or 123451234512345123451234512345123451234512345
                    Got        bcdefbcdefbcdefbcdefbcdefbcdefbcdefbcdefbcdef

        """
        def hash_then_or(hash_name):
            # For now, all the decent hashes have 6-char names, so we can get
            # away with hard-coding space literals.
            return chain([hash_name], repeat('    or'))

        lines = []
        for hash_name, expecteds in iteritems(self.allowed):
            prefix = hash_then_or(hash_name)
            lines.extend(('        Expected %s %s' % (next(prefix), e))
                         for e in expecteds)
            lines.append('             Got        %s\n' %
                         self.gots[hash_name].hexdigest())
            prefix = '    or'
        return '\n'.join(lines)


class UnsupportedPythonVersion(InstallationError):
    """Unsupported python version according to Requires-Python package
    metadata."""

SILENT KILLER Tool