`8(Zc@@sddlmZddlZddlZddlZddlmZddlmZddl m Z ddl m Z m Z ejeZdefdYZd ZdS( i(tabsolute_importN(tCommand(tERROR(t read_chunks(t FAVORITE_HASHt STRONG_HASHESt HashCommandcB@s2eZdZdZdZdZdZdZRS(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-build-0nEYGB/pip/pip/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-build-0nEYGB/pip/pip/commands/hash.pytrun(s   (t__name__t __module__t__doc__tnametusagetsummaryRR!(((s./tmp/pip-build-0nEYGB/pip/pip/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-build-0nEYGB/pip/pip/commands/hash.pyR3s (t __future__RR*tloggingRtpip.basecommandRtpip.status_codesRt pip.utilsRtpip.utils.hashesRRt getLoggerR"RRR(((s./tmp/pip-build-0nEYGB/pip/pip/commands/hash.pyts   #