ó 9ÕÒTc@@sõddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z m Z m Z ddlmZddlmZddlmZddlmZejeƒZdefd „ƒYZdS( i(tabsolute_importN(t display_patht backup_dirtrmtree(tRemovedInPip7Warning(t indent_log(tInstallationError(tCommandt ZipCommandcB@sƒeZdZdZdZdZd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„ZRS(sZip individual packages.tzips# %prog [options] ...s$DEPRECATED. Zip individual packages.c O@s9tt|ƒj||Ž|jdkrM|jjdddddddƒn(|jjd dd ddd tdd ƒ|jjd ddddddƒ|jjddddddddƒ|jjdddddddƒ|jjdddddddƒ|jjddddddƒ|jjd|jƒdS(NR s--unziptactiont store_truetdesttunzipthelps"Unzip (rather than zip) a package.s--zipt store_falsetdefaults"Zip (rather than unzip) a package.s--no-pyctno_pycsEDo not include .pyc files in zip files (useful on Google App Engine).s-ls--listtlists2List the packages available, and their zip status.s --sort-filest sort_filessDWith --list, sort packages according to how many files they contain.s--pathtappendtpathss?Restrict operations to the given paths (may include wildcards).s-ns --simulates0Do not actually perform the zip/unzip operation.i( tsuperRt__init__tnametcmd_optst add_optiontTruetparsertinsert_option_group(tselftargstkw((s6/usr/lib/python2.7/vendor-packages/pip/commands/zip.pyRsL          cC@sk|jstjSg}tƒ}xùtjD]î}tjjtjj|ƒƒ}xÇ|jD]}tjjtjj|ƒƒ}d|krÇtjt j |dƒ|ƒrô|j |ƒ|j |ƒPqôqW|j |ƒrW|j |ƒ|j |ƒPqWqWWtjd|dj|jƒƒq)WxI|jD]>}||kr%d|kr%|j |ƒtjd|ƒq%q%W|S(s:All the entries of sys.path, possibly restricted by --patht*s,Skipping path %s because it doesn't match %ss, sDAdding path %s because it doesn't match anything already on sys.path(t select_pathstsystpathtsettostnormcasetabspathtretsearchtfnmatcht translateRtaddt startswithtloggertdebugtjoin(Rtresultt match_anyR$tmatch((s6/usr/lib/python2.7/vendor-packages/pip/commands/zip.pyRNs8        cC@sVtjdtƒ|j|_|j|_|jrA|j||ƒS|sVtdƒ‚ng}x |D]˜}|j|ƒ\}}|j r²t j j |ƒr²td||fƒ‚n6|j rèt j j |ƒ rètd||fƒ‚n|j ||fƒqcWd}xJ|D]B\}}|j r6|j||ƒ}q |j|||jƒ}q W|S(NsR'pip zip' and 'pip unzip` are deprecated, and will be removed in a future release.s2You must give at least one package to zip or unzips;The module %s (in %s) is not a zip file; cannot be unzippeds:The module %s (in %s) is not a directory; cannot be zipped(twarningstwarnRRR"tsimulateRRt find_packageR R&R$tisdirRtNonet unzip_packaget zip_packageR(RtoptionsRtpackagestargt module_nametfilenamet last_status((s6/usr/lib/python2.7/vendor-packages/pip/commands/zip.pytrunrs:      c C@s¶tjj|ƒ}tjj|ƒ rPtj|ƒrPtd|||fƒ‚ntjj|ƒ}||jƒkrŸtj dt |ƒt |ƒt |ƒƒntj d|t |ƒƒ|j rÒtj dƒdSt ƒÕtj|ƒ}g}x|jƒD] }|j}|j|tjjƒrí|j|ƒ} tjj||ƒ} tjjtjj| ƒƒs„tjtjj| ƒƒn| rÅ| jtjjƒrÅtjj| ƒsêtj| ƒqêq t| dƒ} | j| ƒWdQXqþ|j||j|ƒfƒqþW|jƒ|sPtjdt |ƒƒtj|ƒ|j|ƒn\tjd|t |ƒƒtj|dƒ}x$|D]\}} |j|| ƒq‚W|jƒWdQXdS( Ns3Module %s (in %s) isn't located in a zip file in %ss/Unpacking %s into %s, but %s is not on sys.pathsUnzipping %s (in %s)s3Skipping remaining operations because of --simulatetwbsRemoving now-empty zip file %ss(Removing entries in %s/ from zip file %stw( R&R$tdirnametisfiletzipfilet is_zipfileRRR/twarningRtinfoR7RtZipFiletinfolistRAR.tseptreadR1texiststmakedirstendswithtopentwriteRtcloseR0tunlinktremove_filename_from_pthtwritestr( RR@RAt zip_filenamet package_pathR tto_saveRKRtcontentR tf((s6/usr/lib/python2.7/vendor-packages/pip/commands/zip.pyR;™sd          c C@sBtjd|t|ƒƒ|}|jdƒr7|}n |d}tƒò||kr•t|ƒ}tjd||ƒ|js•tj||ƒq•ny‰tj dt|ƒƒ|jsñt j |dƒ}|j |ddƒxt j|ƒD]ó\}}} |r3g| D]!} | jƒjd ƒs | ^q } nxª|tf| tfgD]\} } x| D]y} t jj|| ƒ}t jj||t|ƒjt jjƒ| ƒ}| rÈ|j |ddƒq_|j||ƒq_WqLWqíW|jƒntj d t|ƒƒ|jst|ƒnWn ‚nX|j|ƒWdQXdS( NsZip %s (in %s)s.eggs.zipsMoving %s aside to %ssCreating zip file in %sREt/ts.pycsRemoving old directory %s(R/RKRRRRRR7tshutiltmoveR0RHRLRXR&twalktlowerRtFalseR$R1tlentlstripRNRTRURtadd_filename_to_pth(RR@RARt orig_filenamet dest_filenameR tdirpathtdirnamest filenamesR]tfnstis_dirtfntfullR ((s6/usr/lib/python2.7/vendor-packages/pip/commands/zip.pyR<×sT         $"      cC@s1x|jƒD]}t|dƒ}|jƒ}WdQXg|D]}|jƒ|kr>|^q>}||kr tjdt|ƒt|ƒƒg|D]}|r”|^q”sÞtjdt|ƒƒ|jstj |ƒqn1|jst|dƒ}|j |ƒWdQXndSq Wtj dt|ƒƒdS(Ntrs*Removing reference to %s from .pth file %ss %s file would be empty: deletingRDs.Cannot find a reference to %s in any .pth file( t pth_filesRSt readlineststripR/R0RR7R&RVt writelinesRJ(RRAtpthR]tlinestlt new_linestline((s6/usr/lib/python2.7/vendor-packages/pip/commands/zip.pyRWs*+     cC@sýtjj|ƒ}|d}||jƒkrGtjdt|ƒƒn|jsùtjj|ƒrÄt |ƒ}|j ƒ}WdQX|r°|dj dƒ r°|dcd7ŒssUnzipped packages:s%s (%i files)sNo unzipped packages.(s.pths .egg-infos .egg-link(RtsortedRR&R$RPtbasenametrstripRNRGRHRIRFR/RKRtreplaceRRRR{tsplitextRcR0R1R9Rt count_packageRtsort( RR=RR$R‚tzippedtunzippedRAtextRptcount((s6/usr/lib/python2.7/vendor-packages/pip/commands/zip.pyRZsb !!              cC@skd}x^tj|ƒD]M\}}}g|D]!}|jƒjdƒs,|^q,}|t|ƒ7}qW|S(Nis.pyc(R&RbRcRRRe(RR$ttotalRjRkRlR]((s6/usr/lib/python2.7/vendor-packages/pip/commands/zip.pyR†”s  !(t__name__t __module__t__doc__RtusagetsummaryRRRCR;R<RWRgRrR8RR†(((s6/usr/lib/python2.7/vendor-packages/pip/commands/zip.pyRs 1 $ ' > 8     :(t __future__RR#R)R+tloggingR&R`R5RHt pip.utilsRRRtpip.utils.deprecationRtpip.utils.loggingRtpip.exceptionsRtpip.basecommandRt getLoggerRR/R(((s6/usr/lib/python2.7/vendor-packages/pip/commands/zip.pyts