ó †2{Yc@s®ddlZddlZddlZddlZddlZddlZddlmZmZm Z ddl m Z ddl m Z ddlmZdefd„ƒYZdS(iÿÿÿÿN(t display_patht backup_dirtrmtree(tlogger(tInstallationError(tCommandt ZipCommandcBsƒ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 Os9tt|ƒj||Ž|jdkrM|jjdddddddƒn(|jjd dd ddd tdd ƒ|jjd ddddddƒ|jjddddddddƒ|jjdddddddƒ|jjdddddddƒ|jjddddddƒ|jjd|jƒdS(NRs--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((sA/opt/alt/python33/lib/python3.3/site-packages/pip/commands/zip.pyRsL          cCsp|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ƒfƒq)WxJ|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 startswithRtdebugtjoin(Rtresultt match_anyR"tmatch((sA/opt/alt/python33/lib/python3.3/site-packages/pip/commands/zip.pyR>s2          cCsVtjddƒ|j|_|j|_|jrA|j||ƒS|sVtdƒ‚ng}x |D]˜}|j|ƒ\}}|jr²t j j |ƒr²td||fƒ‚n6|j rèt j j |ƒ rètd||fƒ‚n|j ||fƒqcWd}xJ|D]B\}}|jr6|j||ƒ}q |j|||jƒ}q W|S(Ns1.7s_DEPRECATION: '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(Rt deprecatedRR tsimulateRRt find_packageR R$R"tisdirRtNonet unzip_packaget zip_packageR(RtoptionsRtpackagestargt module_nametfilenamet last_status((sA/opt/alt/python33/lib/python3.3/site-packages/pip/commands/zip.pytrun\s4      c CsÚtjj|ƒ}tjj|ƒ rPtj|ƒrPtd|||fƒ‚ntjj|ƒ}||jƒkr£tj dt |ƒt |ƒt |ƒfƒntj d|t |ƒfƒ|j rÚtj dƒdStj d7_ zÚtj|ƒ}g}x|jƒD] }|j}|j|tjjƒrþ|j|ƒ} tjj||ƒ} tjjtjj| ƒƒs”tjtjj| ƒƒn| rÕ| jtjjƒrÕtjj| ƒsûtj| ƒqûqt| dƒ} | j| ƒ| jƒq|j||j|ƒfƒqW|jƒ|sbtjdt |ƒƒtj|ƒ|j|ƒn`tjd|t |ƒfƒtj|d ƒ}x$|D]\}} |j|| ƒq˜W|jƒWdtj d8_ XdS( 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 --simulateitwbsRemoving now-empty zip file %ss(Removing entries in %s/ from zip file %stw( R$R"tdirnametisfiletzipfilet is_zipfileRRRtwarnRtnotifyR3tindenttZipFiletinfolistR=R,tseptreadR.texiststmakedirstendswithtopentwritetcloseRtinfotunlinktremove_filename_from_pthtwritestr( RR<R=t zip_filenamet package_pathRtto_saveRSRtcontentR tf((sA/opt/alt/python33/lib/python3.3/site-packages/pip/commands/zip.pyR7{sX"        cCsb|}tjd|t|ƒfƒtjd7_|jdƒrJ|}n |d}z÷||kr¥t|ƒ}tjd||fƒ|js¥tj||ƒq¥ny‹tj dt|ƒƒ|jst j |dƒ}|j |dd ƒxt j|ƒD]ó\}}} |rDg| D]!} | jƒjd ƒs| ^q} nxª|tf| tfgD]\} } x| D]y} t jj|| ƒ}t jj||t|ƒjt jjƒ| ƒ}| rÙ|j |dd ƒqp|j||ƒqpWq]WqþW|jƒntj d t|ƒƒ|js/t|ƒnWn ‚nX|j|ƒWdtjd8_XdS( NsZip %s (in %s)is.eggs.zipsMoving %s aside to %ssCreating zip file in %sRAt/ts.pycsRemoving old directory %s(RRGRRHRORR3tshutiltmoveRSRDRIRVR$twalktlowerRtFalseR"R.tlentlstripRKRQRRRtadd_filename_to_pth(RR<R=Rt orig_filenamet dest_filenameRtdirpathtdirnamest filenamesR[tfnstis_dirtfntfullR ((sA/opt/alt/python33/lib/python3.3/site-packages/pip/commands/zip.pyR8®sH       $% 1  cCs9x|jƒD] }t|dƒ}|jƒ}|jƒg|D]}|jƒ|kr?|^q?}||kr tjdt|ƒt|ƒfƒg|D]}|r™|^q™sätjdt|ƒƒ|jst j |ƒqn2|jst|dƒ}|j |ƒ|jƒndSq Wtj dt|ƒƒdS(Ntrs*Removing reference to %s from .pth file %ss %s file would be empty: deletingR@s.Cannot find a reference to %s in any .pth file( t pth_filesRPt readlinesRRtstripRRSRR3R$RTt writelinesRF(RR=tpthR[tlinestlt new_linestline((sA/opt/alt/python33/lib/python3.3/site-packages/pip/commands/zip.pyRUÚs$  +      cCstjj|ƒ}|d}||jƒkrHtjdt|ƒƒn|jsütjj|ƒrÆt |ƒ}|j ƒ}|j ƒ|r²|dj dƒ r²|dcd7LssUnzipped packages:s%s (%i files)sNo unzipped packages.(s.pths .egg-infos .egg-link(RtsortedRR$R"RMtbasenametrstripRKRCRDRERBRRGRtreplaceRORHRytsplitextRaRSR.R5Rt count_packageRtsort( RR9RR"R€tzippedtunzippedR=textRntcount((sA/opt/alt/python33/lib/python3.3/site-packages/pip/commands/zip.pyRsf !!       cCskd}x^tj|ƒD]M\}}}g|D]!}|jƒjdƒs,|^q,}|t|ƒ7}qW|S(Nis.pyc(R$R`RaRORc(RR"ttotalRhRiRjR[((sA/opt/alt/python33/lib/python3.3/site-packages/pip/commands/zip.pyR„Ys  !(t__name__t __module__t__doc__RtusagetsummaryRRR?R7R8RUReRpR4RR„(((sA/opt/alt/python33/lib/python3.3/site-packages/pip/commands/zip.pyR s *   3 ,     ;(R!R'R)R$R^RDtpip.utilRRRtpip.logRtpip.exceptionsRtpip.basecommandRR(((sA/opt/alt/python33/lib/python3.3/site-packages/pip/commands/zip.pyts