I iddlZddlZddlZddlmZddlmZddlmZm Z ddl m Z m Z ddl mZmZej eZGddeZd ed ed efd Zy) N)Values)Command)ERRORSUCCESS) FAVORITE_HASH STRONG_HASHES) read_chunks write_outputc:eZdZdZdZdZd dZdedee de fd Z y) 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 |jjdddtdtdj dj t|j jd|jy) Nz-az --algorithm algorithmstorez$The hash algorithm to use: one of {}z, )destchoicesactiondefaulthelpr)cmd_opts add_optionrrformatjoinparserinsert_option_group)selfs a/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/pip/_internal/commands/hash.py add_optionszHashCommand.add_optionss_    !!7>> -( !  ''4==9optionsargsc |s/|jjtjtS|j }|D]}t d||t||tS)Nz%s: --hash=%s:%s) r print_usagesysstderrrrr _hash_of_filer)rr r!rpaths rrunzHashCommand.run'sY KK # #CJJ /L%%  D #T9mD)6T  r)r N) __name__ __module__ __qualname____doc__usageignore_require_venvrrliststrintr(rrr r s7 )E : 6 c s rr r'rr ct|d5}tj|}t|D]}|j | ddd|j S#1swYj SxYw)z!Return the hash digest of a file.rbN)openhashlibnewr update hexdigest)r'rarchivehashchunks rr&r&4sj dD W{{9% ) E KK   >>   >> s 7AA5)r6loggingr$optparserpip._internal.cli.base_commandrpip._internal.cli.status_codesrrpip._internal.utils.hashesrrpip._internal.utils.miscr r getLoggerr)loggerr r0r&r2rrrEsV 29C>   8 $#'#Lr