1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
U
H=®d3ã@s®ddlmZddlZddlZddlZddlmZddlmZm    Z    ddl
m Z m Z ddl mZmZddlmZerˆddlmZdd    lmZe e¡ZGd
d „d eƒZd d „ZdS)é)Úabsolute_importN)ÚCommand)ÚERRORÚSUCCESS)Ú FAVORITE_HASHÚ STRONG_HASHES)Ú read_chunksÚ write_output)ÚMYPY_CHECK_RUNNING)ÚValues)ÚListc@s(eZdZdZdZdZdd„Zdd„ZdS)    Ú HashCommandz
    Compute a hash of a local package archive.
 
    These can be used with --hash in a requirements file to do repeatable
    installs.
    z%prog [options] <file> ...Tc Cs:|jjdddtdtd d t¡¡d|j d|j¡dS)    Nz-az --algorithmÚ    algorithmÚstorez$The hash algorithm to use: one of {}z, )ÚdestÚchoicesÚactionÚdefaultÚhelpr)Úcmd_optsÚ
add_optionrrÚformatÚjoinÚparserÚinsert_option_group)Úself©rúRD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pip/_internal/commands/hash.pyÚ add_optionssÿúzHashCommand.add_optionscCs>|s|j tj¡tS|j}|D]}td||t||ƒƒq tS)Nz%s:
--hash=%s:%s)    rÚ print_usageÚsysÚstderrrrr    Ú _hash_of_filer)rÚoptionsÚargsrÚpathrrrÚrun+sÿzHashCommand.runN)Ú__name__Ú
__module__Ú __qualname__Ú__doc__ÚusageÚignore_require_venvrr&rrrrr s
 r c    Cs@t|dƒ(}t |¡}t|ƒD]}| |¡qW5QRX| ¡S)z!Return the hash digest of a file.Úrb)ÚopenÚhashlibÚnewrÚupdateÚ    hexdigest)r%rÚarchiveÚhashÚchunkrrrr"8s
 
 r")Ú
__future__rr/Úloggingr Úpip._internal.cli.base_commandrÚpip._internal.cli.status_codesrrÚpip._internal.utils.hashesrrÚpip._internal.utils.miscrr    Úpip._internal.utils.typingr
Úoptparser Útypingr Ú    getLoggerr'Úloggerr r"rrrrÚ<module>s     
$