� ��abc@@s�ddlmZddlZddlZddlZddlmZddlmZddl m Z ddl m Z m Z eje�Zdefd��YZd �ZdS( i(tabsolute_importN(tCommand(tERROR(t read_chunks(t FAVORITE_HASHt STRONG_HASHESt HashCommandcB@s2eZdZdZdZdZd�Zd�ZRS(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 |j�dS( Ns-as --algorithmtdestt algorithmtchoicestactiontstoretdefaultthelps$The hash algorithm to use: one of %ss, i( tsuperRt__init__tcmd_optst add_optionRRtjointparsertinsert_option_group(tselftargstkw((s5/usr/lib/python2.7/site-packages/pip/commands/hash.pyRs  cC@sZ|s|jjtj�tS|j}x-|D]%}tjd||t||��q-WdS(Ns%s: --hash=%s:%s( Rt print_usagetsyststderrRR tloggertinfot _hash_of_file(RtoptionsRR tpath((s5/usr/lib/python2.7/site-packages/pip/commands/hash.pytrun(s   (t__name__t __module__t__doc__tnametusagetsummaryRR!(((s5/usr/lib/python2.7/site-packages/pip/commands/hash.pyRs  cC@sUt|d��:}tj|�}x!t|�D]}|j|�q.WWdQX|j�S(s!Return the hash digest of a file.trbN(topenthashlibtnewRtupdatet hexdigest(R R tarchiveRtchunk((s5/usr/lib/python2.7/site-packages/pip/commands/hash.pyR3s (t __future__RR*tloggingRtpip.basecommandRtpip.status_codesRt pip.utilsRtpip.utils.hashesRRt getLoggerR"RRR(((s5/usr/lib/python2.7/site-packages/pip/commands/hash.pyts   #