관리-도구
편집 파일: zip.cpython-34.pyc
� �Re�9 � @ 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_dir�rmtree)�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] <package> ...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--unzip�action� store_true�dest�unzip�helpz"Unzip (rather than zip) a package.z--zip�store_false�defaultTz"Zip (rather than unzip) a package.z--no-pyc�no_pyczEDo not include .pyc files in zip files (useful on Google App Engine).z-lz--list�listz2List the packages available, and their zip status.z--sort-files� sort_fileszDWith --list, sort packages according to how many files they contain.z--path�append�pathsz?Restrict operations to the given paths (may include wildcards).z-nz --simulatez0Do not actually perform the zip/unzip operation.r )�superr �__init__�name�cmd_opts� add_option�parser�insert_option_group)�self�args�kw)� __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_paths�sys�path�set�os�normcase�abspath�re�search�fnmatch� translater �add� startswithr �debug�join)r �result� match_anyr&