UA d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZm Z d dl
mZmZ d dl
mZmZ ej e Z G d de Zd ed
edefdZdS )
N)Values)Command)ERRORSUCCESS)
FAVORITE_HASH
STRONG_HASHES)read_chunkswrite_outputc B e Zd ZdZdZdZd
dZdedee de
fd 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] ...TreturnNc
| j dddt dt d d t | j d| j d S ) Nz-az--algorithm algorithmstorez$The hash algorithm to use: one of {}z, )destchoicesactiondefaulthelpr )cmd_opts
add_optionr r formatjoinparserinsert_option_group)selfs m/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/pip/_internal/commands/hash.pyadd_optionszHashCommand.add_options sw
!!7>> -(( !
''4=99999 optionsargsc
|s+| j t j t S |j }|D ]"}t
d||t || #t S )Nz%s:
--hash=%s:%s) r print_usagesysstderrr r r
_hash_of_filer )r r r! r paths r runzHashCommand.run' so K##CJ///L% D#T9mD)6T6T
r )r
N)__name__
__module____qualname____doc__usageignore_require_venvr r liststrintr( r r r r sl
)E: : : :
6
c
s
r r r' r r
c t | d 5 }t j | }t | D ]}| | ddd n# 1 swxY w Y | S )z!Return the hash digest of a file.rbN)openhashlibnewr update hexdigest)r' r archivehashchunks r r&