7iddlZddlZddlZddlmZddlmZddlmZddl m Z m Z ddl m Z mZddlmZmZej$eZGdd eZd ed ed efd Zy)N)Values)List)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_optionr rformatjoinparserinsert_option_group)selfs d/mnt/ssd/data/python-lab/ChefSystem/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 )rN) __name__ __module__ __qualname____doc__usageignore_require_venvrrrstrintr)r rr r s7 )E : 6 c s r r r(rrct|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'5sj dD W{{9% ) E KK   >>   >> s 7AA5)r6loggingr%optparsertypingrpip._internal.cli.base_commandrpip._internal.cli.status_codesrrpip._internal.utils.hashesrr pip._internal.utils.miscr r getLoggerr*loggerr r0r'r2r rrFsY 29C>   8 $#'#Lr