AlkantarClanX12

Your IP : 18.190.160.6


Current Path : /proc/self/root/usr/lib/python3.6/site-packages/pip/__pycache__/
Upload File :
Current File : //proc/self/root/usr/lib/python3.6/site-packages/pip/__pycache__/exceptions.cpython-36.pyc

3

�Pf��@sddZddlmZddlmZmZmZddlmZGdd�de	�Z
Gdd�de
�ZGd	d
�d
e
�ZGdd�de�Z
Gd
d�de�ZGdd�de
�ZGdd�de
�ZGdd�de
�ZGdd�de
�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�ZGd#d$�d$e�ZGd%d&�d&e�ZGd'd(�d(e�ZGd)d*�d*e�Zd+S),z"Exceptions used throughout package�)�absolute_import)�chain�groupby�repeat)�	iteritemsc@seZdZdZdS)�PipErrorzBase pip exceptionN)�__name__�
__module__�__qualname__�__doc__�rr� /usr/lib/python3.6/exceptions.pyr	src@seZdZdZdS)�InstallationErrorz%General exception during installationN)rr	r
rrrrr
r
src@seZdZdZdS)�UninstallationErrorz'General exception during uninstallationN)rr	r
rrrrr
rsrc@seZdZdZdS)�DistributionNotFoundzCRaised when a distribution cannot be found to satisfy a requirementN)rr	r
rrrrr
rsrc@seZdZdZdS)�RequirementsFileParseErrorzDRaised when a general error occurs parsing a requirements file line.N)rr	r
rrrrr
rsrc@seZdZdZdS)�BestVersionAlreadyInstalledzNRaised when the most up-to-date version of a package is already
    installed.N)rr	r
rrrrr
rsrc@seZdZdZdS)�
BadCommandz0Raised when virtualenv or a command is not foundN)rr	r
rrrrr
r"src@seZdZdZdS)�CommandErrorz7Raised when there is an error in command-line argumentsN)rr	r
rrrrr
r&src@seZdZdZdS)�PreviousBuildDirErrorz:Raised when there's a previous conflicting build directoryN)rr	r
rrrrr
r*src@seZdZdZdS)�InvalidWheelFilenamezInvalid wheel filename.N)rr	r
rrrrr
r.src@seZdZdZdS)�UnsupportedWheelzUnsupported wheel.N)rr	r
rrrrr
r2src@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�
HashErrorsz:Multiple HashError instances rolled into one for reportingcCs
g|_dS)N)�errors)�selfrrr
�__init__9szHashErrors.__init__cCs|jj|�dS)N)r�append)r�errorrrr
r<szHashErrors.appendcCsfg}|jjdd�d�x<t|jdd��D](\}}|j|j�|jdd�|D��q(W|rbdj|�SdS)NcSs|jS)N)�order)�errr
�<lambda>Asz$HashErrors.__str__.<locals>.<lambda>)�keycSs|jS)N)�	__class__)rrrr
r Bscss|]}|j�VqdS)N)�body)�.0rrrr
�	<genexpr>Dsz%HashErrors.__str__.<locals>.<genexpr>�
)r�sortrr�head�extend�join)r�lines�clsZ
errors_of_clsrrr
�__str__?szHashErrors.__str__cCs
t|j�S)N)�boolr)rrrr
�__nonzero__HszHashErrors.__nonzero__cCs|j�S)N)r/)rrrr
�__bool__KszHashErrors.__bool__N)	rr	r
rrrr-r/r0rrrr
r6s	rc@s0eZdZdZdZdZdd�Zdd�Zdd	�ZdS)
�	HashErrora�
    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.

    N�cCsd|j�S)a)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

        z    %s)�_requirement_name)rrrr
r#bs
zHashError.bodycCsd|j|j�fS)Nz%s
%s)r(r#)rrrr
r-nszHashError.__str__cCs|jrt|j�SdS)z�Return a description of the requirement that triggered me.

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

        zunknown package)�req�str)rrrr
r3qszHashError._requirement_name)	rr	r
rr4r(r#r-r3rrrr
r1Osr1c@seZdZdZdZdZdS)�VcsHashUnsupportedzuA hash was provided for a version-control-system-based requirement, but
    we don't have a method for hashing those.rzlCan't verify hashes for these requirements because we don't have a way to hash version control repositories:N)rr	r
rrr(rrrr
r6{sr6c@seZdZdZdZdZdS)�DirectoryUrlHashUnsupportedzuA hash was provided for a version-control-system-based requirement, but
    we don't have a method for hashing those.�zUCan't verify hashes for these file:// requirements because they point to directories:N)rr	r
rrr(rrrr
r7�sr7c@s(eZdZdZdZdZdd�Zdd�ZdS)	�HashMissingz2A hash was needed for a requirement but is absent.�awHashes 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.)cCs
||_dS)zq
        :param gotten_hash: The hash of the (possibly malicious) archive we
            just downloaded
        N)�gotten_hash)rr;rrr
r�szHashMissing.__init__cCsHddlm}d}|jr4|jjr&|jjnt|jdd�}d|p<d||jfS)Nr)�
FAVORITE_HASHr4z    %s --hash=%s:%szunknown package)Zpip.utils.hashesr<r4Z
original_link�getattrr;)rr<�packagerrr
r#�szHashMissing.bodyN)rr	r
rrr(rr#rrrr
r9�s
r9c@seZdZdZdZdZdS)�HashUnpinnedzPA requirement had a hash specified but was not pinned to a specific
    version.�zaIn --require-hashes mode, all requirements must have their versions pinned with ==. These do not:N)rr	r
rrr(rrrr
r?�sr?c@s0eZdZdZdZdZdd�Zdd�Zdd	�Zd
S)�HashMismatchz�
    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.

    �z�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.cCs||_||_dS)z�
        :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
        N)�allowed�gots)rrCrDrrr
r�szHashMismatch.__init__cCsd|j�|j�fS)Nz
    %s:
%s)r3�_hash_comparison)rrrr
r#�szHashMismatch.bodycsjdd�}g}xRt|j�D]D\}}||��|j�fdd�|D��|jd|j|j��d�qWdj|�S)aE
        Return a comparison of actual and expected hash values.

        Example::

               Expected sha256 abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde
                            or 123451234512345123451234512345123451234512345
                    Got        bcdefbcdefbcdefbcdefbcdefbcdefbcdefbcdefbcdef

        cSst|gtd��S)Nz    or)rr)�	hash_namerrr
�hash_then_or�sz3HashMismatch._hash_comparison.<locals>.hash_then_orc3s|]}dt��|fVqdS)z        Expected %s %sN)�next)r$r)�prefixrr
r%�sz0HashMismatch._hash_comparison.<locals>.<genexpr>z             Got        %s
z    orr&)rrCr)rrDZ	hexdigestr*)rrGr+rFZ	expectedsr)rIr
rE�s
zHashMismatch._hash_comparisonN)	rr	r
rrr(rr#rErrrr
rA�s
rAc@seZdZdZdS)�UnsupportedPythonVersionzMUnsupported python version according to Requires-Python package
    metadata.N)rr	r
rrrrr
rJ�srJN)rZ
__future__r�	itertoolsrrrZpip._vendor.sixr�	Exceptionrrrrrrrrrrrrr1r6r7r9r?rArJrrrr
�<module>s,,		$	8