HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/site-packages/pip/_internal/commands/__pycache__/hash.cpython-37.pyc
B

L��g��@s�ddlZddlZddlZddlmZddlmZddlmZddl	m
Z
mZddlm
Z
mZddlmZmZe�e�ZGdd	�d	e�Zeeed
�dd�ZdS)
�N)�Values)�List)�Command)�ERROR�SUCCESS)�
FAVORITE_HASH�
STRONG_HASHES)�read_chunks�write_outputc@s<eZdZdZdZdZdd�dd�Zeee	e
d�d	d
�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> ...TN)�returnc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�?/tmp/pip-unpacked-wheel-hv55ucu3/pip/_internal/commands/hash.py�add_optionsszHashCommand.add_options)�options�argsrcCsB|s|j�tj�tS|j}x |D]}td||t||��q"WtS)Nz%s:
--hash=%s:%s)	r�print_usage�sys�stderrrr
r
�
_hash_of_filer)rrrr
�pathrrr�run(s
zHashCommand.run)�__name__�
__module__�__qualname__�__doc__�usage�ignore_require_venvrrr�str�intr%rrrrrs
r)r$r
rc	CsDt|d��,}t�|�}xt|�D]}|�|�q WWdQRX|��S)z!Return the hash digest of a file.�rbN)�open�hashlib�newr	�update�	hexdigest)r$r
�archive�hash�chunkrrrr#5s

r#)r0�loggingr!�optparser�typingr�pip._internal.cli.base_commandr�pip._internal.cli.status_codesrr�pip._internal.utils.hashesrr�pip._internal.utils.miscr	r
�	getLoggerr&�loggerrr,r#rrrr�<module>s
&