Re9 @ s d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z m Z m Z d d l
m Z d d l m
Z
d d l m Z Gd d d e Z d S) N)display_path
backup_dirrmtree)logger)InstallationError)Commandc s e Z d Z d Z d Z d Z d Z f d d Z d d Z d d
Z d d Z
d
d Z d d Z d d Z
d d Z d d Z d d Z d d Z S)
ZipCommandzZip individual packages.zipz#
%prog [options] ...z$DEPRECATED. Zip individual packages.c
s9 t t | j | | | j d k rM | j j d d d d d d d n( | j j d d d
d d d d d d
| j j d d d d d d d | j j d d d d d d d d | j j d d d d d d d | j j d d d d d d d | j j d d d d d d | j j d | j d S) Nr z--unzipaction
store_truedestunziphelpz"Unzip (rather than zip) a package.z--zipstore_falsedefaultTz"Zip (rather than unzip) a package.z--no-pycno_pyczEDo not include .pyc files in zip files (useful on Google App Engine).z-lz--listlistz2List the packages available, and their zip status.z--sort-files
sort_fileszDWith --list, sort packages according to how many files they contain.z--pathappendpathsz?Restrict operations to the given paths (may include wildcards).z-nz
--simulatez0Do not actually perform the zip/unzip operation.r )superr __init__namecmd_opts
add_optionparserinsert_option_group)selfargskw) __class__ +/tmp/pip-ztkk0jow-build/pip/commands/zip.pyr sL
zZipCommand.__init__c C sp | j s t j Sg } t } x t j D] } t j j t j j | } x | j D] } t j j t j j | } d | k r t j t j
| d | r | j | | j | Pq qW | j
| rW | j | | j | PqW qW Wt j d | d j | j f q) WxJ | j D]? } | | k r)d | k r)| j | t j d | q)q)W| S)z:All the entries of sys.path, possibly restricted by --path*z,Skipping path %s because it doesn't match %sz, zDAdding path %s because it doesn't match anything already on sys.path)select_pathssyspathsetosnormcaseabspathresearchfnmatch translater add
startswithr debugjoin)r result match_anyr&