AlkantarClanX12

Your IP : 13.58.200.16


Current Path : /lib/python2.7/site-packages/pip/utils/
Upload File :
Current File : //lib/python2.7/site-packages/pip/utils/hashes.pyc

�
��abc@@s�ddlmZddlZddlmZmZmZddlmZddl	m
Z
mZmZdZ
dddgZd	efd
��YZdefd��YZdS(
i(tabsolute_importN(tHashMismatchtHashMissingtInstallationError(tread_chunks(t	iteritemstiterkeyst
itervaluestsha256tsha384tsha512tHashescB@sPeZdZdd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	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((s4/usr/lib/python2.7/site-packages/pip/utils/hashes.pyt__init__scC@s�i}xXt|j�D]G}ytj|�||<Wqttfk
r\td|��qXqWx2|D]*}x!t|�D]}|j|�q{WqhWx7t	|�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: %sN(RR
thashlibtnewt
ValueErrort	TypeErrorRRtupdateRt	hexdigestt_raise(Rtchunkstgotst	hash_nametchunkthashtgot((s4/usr/lib/python2.7/site-packages/pip/utils/hashes.pytcheck_against_chunks s
cC@st|j|��dS(N(RR
(RR((s4/usr/lib/python2.7/site-packages/pip/utils/hashes.pyR7scC@s|jt|��S(saCheck good hashes against a file-like object

        Raise HashMismatch if none match.

        (RR(Rtfile((s4/usr/lib/python2.7/site-packages/pip/utils/hashes.pytcheck_against_file:scC@s)t|d��}|j|�SWdQXdS(Ntrb(topenR (RtpathR((s4/usr/lib/python2.7/site-packages/pip/utils/hashes.pytcheck_against_pathBscC@s
t|j�S(s,Return whether I know any known-good hashes.(tboolR
(R((s4/usr/lib/python2.7/site-packages/pip/utils/hashes.pyt__nonzero__FscC@s
|j�S(N(R&(R((s4/usr/lib/python2.7/site-packages/pip/utils/hashes.pyt__bool__JsN(t__name__t
__module__t__doc__RRRRR R$R&R'(((s4/usr/lib/python2.7/site-packages/pip/utils/hashes.pyRs					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(tsuperR+Rt
FAVORITE_HASH(R((s4/usr/lib/python2.7/site-packages/pip/utils/hashes.pyRUscC@st|tj���dS(N(RR-R(RR((s4/usr/lib/python2.7/site-packages/pip/utils/hashes.pyR[s(R(R)R*RR(((s4/usr/lib/python2.7/site-packages/pip/utils/hashes.pyR+Ns	(t
__future__RRtpip.exceptionsRRRt	pip.utilsRtpip._vendor.sixRRRR-t
STRONG_HASHEStobjectRR+(((s4/usr/lib/python2.7/site-packages/pip/utils/hashes.pyt<module>s: