ok

Mini Shell

Direktori : /proc/self/root/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/
Upload File :
Current File : //proc/self/root/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/hashes.pyc

�
Bu�_c@@s#ddlmZddlZddlmZmZmZddlmZm	Z	m
Z
ddlmZddl
mZer�ddlmZmZmZmZmZddlmZer�dd	lmZq�dd
lmZndZddd
gZdefd��YZdefd��YZdS(i(tabsolute_importN(t	iteritemstiterkeyst
itervalues(tHashMismatchtHashMissingtInstallationError(tread_chunks(tMYPY_CHECK_RUNNING(tDicttListtBinaryIOtNoReturntIterator(tPY3(t_Hash(t_hashtsha256tsha384tsha512tHashescB@sqeZdZdd�Zd�Zed��Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�ZRS(saA wrapper that builds multiple hashes at once and checks them against
    known-good values

    cC@s|dkrin||_dS(so
        :param hashes: A dict of algorithm names pointing to lists of allowed
            hex digests
        N(tNonet_allowed(tselfthashes((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/hashes.pyt__init__)scC@s�t|t�stS|s|S|s'|Si}xbt|j�D]Q\}}||jkr^q=ng|D]}||j|kre|^qe||<q=Wt|�S(N(t
isinstanceRtNotImplementedRR(Rtothertnewtalgtvaluestv((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/hashes.pyt__and__1s4cC@std�|jj�D��S(Ncs@s|]}t|�VqdS(N(tlen(t.0tdigests((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/hashes.pys	<genexpr>Hs(tsumRR(R((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/hashes.pytdigest_countEscC@s||jj|g�kS(s/Return whether the given hex digest is allowed.(Rtget(Rt	hash_namet
hex_digest((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/hashes.pytis_hash_allowedJscC@s�i}x]t|j�D]L}ytj|�||<Wqttfk
ratdj|���qXqWx2|D]*}x!t|�D]}|j	|�q�WqmWx7t
|�D])\}}|j�|j|kr�dSq�W|j|�dS(s�Check good hashes against ones built from iterable of chunks of
        data.

        Raise HashMismatch if none match.

        sUnknown hash name: {}N(
RRthashlibRt
ValueErrort	TypeErrorRtformatRtupdateRt	hexdigestt_raise(RtchunkstgotsR(tchunkthashtgot((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/hashes.pytcheck_against_chunksSs
cC@st|j|��dS(N(RR(RR3((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/hashes.pyR1mscC@s|jt|��S(saCheck good hashes against a file-like object

        Raise HashMismatch if none match.

        (R7R(Rtfile((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/hashes.pytcheck_against_fileqscC@s)t|d��}|j|�SWdQXdS(Ntrb(topenR9(RtpathR8((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/hashes.pytcheck_against_pathzscC@s
t|j�S(s,Return whether I know any known-good hashes.(tboolR(R((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/hashes.pyt__nonzero__scC@s
|j�S(N(R?(R((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/hashes.pyt__bool__�sN(t__name__t
__module__t__doc__RRR!tpropertyR&R*R7R1R9R=R?R@(((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/hashes.pyR$s									t
MissingHashescB@s eZdZd�Zd�ZRS(s�A workalike for Hashes used when we're missing a hash for a requirement

    It computes the actual hash of the requirement and raises a HashMissing
    exception showing it to the user.

    cC@s$tt|�jdigt6�dS(s!Don't offer the ``hashes`` kwarg.RN(tsuperRERt
FAVORITE_HASH(R((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/hashes.pyR�scC@st|tj���dS(N(RRGR0(RR3((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/hashes.pyR1�s(RARBRCRR1(((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/hashes.pyRE�s	(t
__future__RR+tpip._vendor.sixRRRtpip._internal.exceptionsRRRtpip._internal.utils.miscRtpip._internal.utils.typingRttypingR	R
RRR
RRRRGt
STRONG_HASHEStobjectRRE(((sK/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/utils/hashes.pyt<module>s(e

Zerion Mini Shell 1.0