\e[c@@sddlmZddlZddlZddlZddlmZddlmZddl m Z m Z ddl m Z ejeZdefdYZd ZdS( i(tabsolute_importN(tCommand(tERROR(t FAVORITE_HASHt STRONG_HASHES(t read_chunkst HashCommandcB@s8eZdZdZdZdZeZdZdZ RS(s Compute a hash of a local package archive. These can be used with --hash in a requirements file to do repeatable installs. thashs%prog [options] ...s#Compute hashes of package archives.cO@sqtt|j|||jjdddddtdddtd d d jt|jj d |jdS( Ns-as --algorithmtdestt algorithmtchoicestactiontstoretdefaultthelps$The hash algorithm to use: one of %ss, i( tsuperRt__init__tcmd_optst add_optionRRtjointparsertinsert_option_group(tselftargstkw((s:/tmp/pip-install-0xiv62/pip/pip/_internal/commands/hash.pyRs  cC@sZ|s|jjtjtS|j}x-|D]%}tjd||t||q-WdS(Ns%s: --hash=%s:%s( Rt print_usagetsyststderrRR tloggertinfot _hash_of_file(RtoptionsRR tpath((s:/tmp/pip-install-0xiv62/pip/pip/_internal/commands/hash.pytrun(s   ( t__name__t __module__t__doc__tnametusagetsummarytTruetignore_require_venvRR!(((s:/tmp/pip-install-0xiv62/pip/pip/_internal/commands/hash.pyRs cC@sUt|d:}tj|}x!t|D]}|j|q.WWdQX|jS(s!Return the hash digest of a file.trbN(topenthashlibtnewRtupdatet hexdigest(R R tarchiveRtchunk((s:/tmp/pip-install-0xiv62/pip/pip/_internal/commands/hash.pyR3s (t __future__RR,tloggingRtpip._internal.basecommandRtpip._internal.status_codesRtpip._internal.utils.hashesRRtpip._internal.utils.miscRt getLoggerR"RRR(((s:/tmp/pip-install-0xiv62/pip/pip/_internal/commands/hash.pyts   $