AlkantarClanX12
Current Path : /opt/alt/python33/lib64/python3.3/distutils/__pycache__/ |
Current File : //opt/alt/python33/lib64/python3.3/distutils/__pycache__/archive_util.cpython-33.pyc |
� ��f� c @ sJ d Z d d l Z d d l m Z d d l Z y d d l Z Wn e k rX d Z Yn Xd d l m Z d d l m Z d d l m Z d d l m Z d d d d d � Z d d d d � Z i e d g d f d 6e d g d f d 6e d g d f d 6e d g d f d 6e g d f d 6Z d d � Z d d d d d d � Z d S(! uo distutils.archive_util Utility functions for creating archive files (tarballs, zip files, that sort of thing).i N( u warn( u DistutilsExecError( u spawn( u mkpath( u logu gzipc C s i d d 6d d 6d d 6d d 6} i d d 6d d 6d d 6} | d k rj | | j � k rj t d � � n | d } | d k r� | | j | d � 7} n t t j j | � d | �d d l } t j d � | s| j | d | | � } z | j | � Wd | j � Xn | d k r{t d t � | | | } t j d k rX| | | g } n | d | g } t | d | �| S| S( u� Create a (possibly compressed) tar file from all the files under 'base_dir'. 'compress' must be "gzip" (the default), "compress", "bzip2", or None. Both "tar" and the compression utility named by 'compress' must be on the default program search path, so this is probably Unix-specific. The output tar file will be named 'base_dir' + ".tar", possibly plus the appropriate compression extension (".gz", ".bz2" or ".Z"). Returns the output filename. u gzu gzipu bz2u bzip2u u compressu .gzu .bz2u .ZuE bad value for 'compress': must be None, 'gzip', 'bzip2' or 'compress'u .taru dry_runi Nu Creating tar archiveu w|%su 'compress' will be deprecated.u win32u -f( u Noneu keysu ValueErroru getu mkpathu osu pathu dirnameu tarfileu logu infou openu addu closeu warnu PendingDeprecationWarningu sysu platformu spawn( u base_nameu base_diru compressu verboseu dry_runu tar_compressionu compress_extu archive_nameu tarfileu taru compressed_nameu cmd( ( u; /opt/alt/python33/lib64/python3.3/distutils/archive_util.pyu make_tarball s2 " u make_tarballc C s� | d } t t j j | � d | �t d k r� | rA d } n d } y t d | | | g d | �Wq�t k r� t d | � � Yq�Xn t j d | | � | s�y t j | d d t j �} Wn- t k r� t j | d d t j �} Yn Xx� t j | � D]w \ } } } xe | D]] } t j j t j j | | � � } t j j | � r| j | | � t j d | � qqWqW| j � n | S( uv Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_name' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed and found on the default search path). If neither tool is available, raises DistutilsExecError. Returns the name of the output zip file. u .zipu dry_runu -ru -rqu zipuk unable to create zip file '%s': could neither import the 'zipfile' module nor find a standalone zip utilityu# creating '%s' and adding '%s' to itu wu compressionu adding '%s'N( u mkpathu osu pathu dirnameu zipfileu Noneu spawnu DistutilsExecErroru logu infou ZipFileu ZIP_DEFLATEDu RuntimeErroru ZIP_STOREDu walku normpathu joinu isfileu writeu close( u base_nameu base_diru verboseu dry_runu zip_filenameu zipoptionsu zipu dirpathu dirnamesu filenamesu nameu path( ( u; /opt/alt/python33/lib64/python3.3/distutils/archive_util.pyu make_zipfileH s: ! u make_zipfileu compressu gzip'ed tar-fileu gztaru bzip2u bzip2'ed tar-fileu bztaru compressed tar fileu ztaru uncompressed tar fileu taru ZIP fileu zipc C s% x | D] } | t k r | Sq Wd S( uq Returns the first format from the 'format' list that is unknown. If all formats are known, returns None N( u ARCHIVE_FORMATSu None( u formatsu format( ( u; /opt/alt/python33/lib64/python3.3/distutils/archive_util.pyu check_archive_formats� s u check_archive_formatsc C s$ t j � } | d k rS t j d | � t j j | � } | sS t j | � qS n | d k rk t j } n i | d 6} y t | } Wn"