Spade
Mini Shell
| Directory:~$ /proc/self/root/usr/lib/python3.6/site-packages/pip/commands/__pycache__/ |
| [Home] [System Details] [Kill Me] |
3
���^=�@s~ddlmZddlZddlZddlZddlmZddlmZddl m
Z
ddlmZm
Z
eje�ZGdd�de�Zd d
�ZdS)�)�absolute_importN)�Command)�ERROR)�read_chunks)�
FAVORITE_HASH�
STRONG_HASHEScs4eZdZdZdZdZdZ�fdd�Zdd�Z�Z S) �HashCommandz�
Compute a hash of a local package archive.
These can be used with --hash in a requirements file to do repeatable
installs.
�hashz%prog [options] <file> ...z#Compute hashes of package
archives.c
sJtt|�j||�|jjdddtdtddjt�d�|jj d|j�dS) Nz-az--algorithm� algorithmZstorez$The
hash algorithm to use: one of %sz,
)�dest�choices�action�default�helpr)
�superr�__init__Zcmd_optsZ
add_optionrr�join�parserZinsert_option_group)�self�args�kw)� __class__��/usr/lib/python3.6/hash.pyrszHashCommand.__init__cCsD|s|jjtj�tS|j}x"|D]}tjd||t||��q"WdS)Nz%s:
--hash=%s:%s) rZprint_usage�sys�stderrrr
�logger�info�
_hash_of_file)rZoptionsrr
�pathrrr�run(s
zHashCommand.run)
�__name__�
__module__�__qualname__�__doc__�nameZusageZsummaryrr
�
__classcell__rr)rrrsrc
CsDt|d��,}tj|�}xt|�D]}|j|�q
WWdQRX|j�S)z!Return the hash digest of a
file.�rbN)�open�hashlib�newr�updateZ hexdigest)rr
�archiver �chunkrrrr3s
r)Z
__future__rr)ZloggingrZpip.basecommandrZpip.status_codesrZ pip.utilsrZpip.utils.hashesrrZ getLoggerr!rrrrrrr�<module>s
#