Sindbad~EG File Manager
3
�Pf��@sddZddlmZddlmZmZmZddlmZGdd�de �Z
Gdd�de
�ZGd d
�d
e
�ZGdd�de�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__�rr� /usr/lib/python3.6/exceptions.pyr src@seZdZdZdS)�InstallationErrorz%General exception during installationN)rr r
rrrrr
r
src@seZdZdZdS)�UninstallationErrorz'General exception during uninstallationN)rr r
rrrrr
rsrc@seZdZdZdS)�DistributionNotFoundzCRaised when a distribution cannot be found to satisfy a requirementN)rr r
rrrrr
rsrc@seZdZdZdS)�RequirementsFileParseErrorzDRaised when a general error occurs parsing a requirements file line.N)rr r
rrrrr
rsrc@seZdZdZdS)�BestVersionAlreadyInstalledzNRaised when the most up-to-date version of a package is already
installed.N)rr r
rrrrr
rsrc@seZdZdZdS)�
BadCommandz0Raised when virtualenv or a command is not foundN)rr r
rrrrr
r"src@seZdZdZdS)�CommandErrorz7Raised when there is an error in command-line argumentsN)rr r
rrrrr
r&src@seZdZdZdS)�PreviousBuildDirErrorz:Raised when there's a previous conflicting build directoryN)rr r
rrrrr
r*src@seZdZdZdS)�InvalidWheelFilenamezInvalid wheel filename.N)rr r
rrrrr
r.src@seZdZdZdS)�UnsupportedWheelzUnsupported wheel.N)rr r
rrrrr
r2src@s8eZdZdZdd�Zdd�Zdd�Zdd �Zd
d�ZdS)
�
HashErrorsz:Multiple HashError instances rolled into one for reportingcCs
g|_dS)N)�errors)�selfrrr
�__init__9szHashErrors.__init__cCs|jj|�dS)N)r�append)r�errorrrr
r<szHashErrors.appendcCsfg}|jjdd�d�x<t|jdd��D](\}}|j|j�|jdd�|D��q(W|rbdj|�SdS)NcSs|jS)N)�order)�errr
�<lambda>Asz$HashErrors.__str__.<locals>.<lambda>)�keycSs|jS)N)� __class__)rrrr
r Bscss|]}|j�VqdS)N)�body)�.0rrrr
� <genexpr>Dsz%HashErrors.__str__.<locals>.<genexpr>�
)r�sortrr�head�extend�join)r�lines�clsZ
errors_of_clsrrr
�__str__?szHashErrors.__str__cCs
t|j�S)N)�boolr)rrrr
�__nonzero__HszHashErrors.__nonzero__cCs|j�S)N)r/)rrrr
�__bool__KszHashErrors.__bool__N) rr r
rrrr-r/r0rrrr
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�cCsd|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)rrrr
r#bs
zHashError.bodycCsd|j|j�fS)Nz%s
%s)r(r#)rrrr
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)rrrr
r3qszHashError._requirement_name) rr r
rr4r(r#r-r3rrrr
r1Osr1c@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(rrrr
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(rrrr
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;rrr
r�szHashMissing.__init__cCsHddlm}d}|jr4|jjr&|jjnt|jdd�}d|p<d||jfS)Nr)�
FAVORITE_HASHr4z %s --hash=%s:%szunknown package)Zpip.utils.hashesr<r4Z
original_link�getattrr;)rr<�packagerrr
r#�szHashMissing.bodyN)rr r
rrr(rr#rrrr
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(rrrr
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)rrCrDrrr
r�szHashMismatch.__init__cCsd|j�|j�fS)Nz
%s:
%s)r3�_hash_comparison)rrrr
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_namerrr
�hash_then_or�sz3HashMismatch._hash_comparison.<locals>.hash_then_orc3s|]}dt��|fVqdS)z Expected %s %sN)�next)r$r)�prefixrr
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#rErrrr
rA�s
rAc@seZdZdZdS)�UnsupportedPythonVersionzMUnsupported python version according to Requires-Python package
metadata.N)rr r
rrrrr
rJ�srJN)rZ
__future__r� itertoolsrrrZpip._vendor.sixr� Exceptionrrrrrrrrrrrrr1r6r7r9r?rArJrrrr
�<module>s,, $ 8
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists