관리-도구
편집 파일: install_egg_info.cpython-34.pyc
� M�Re� � @ st d d l m Z d d l m Z d d l m Z m Z d d l Z d d l Z d d l Z Gd d � d e � Z d S)� )�Command)�unpack_archive)�log�dir_utilNc @ sy e Z d Z d Z d Z d g Z d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z d d � Z d S)�install_egg_infoz.Install an .egg-info directory for the package�install-dir=�d�directory to install toc C s d | _ d S)N)�install_dir)�self� r �>/tmp/pip-l4uy7dan-build/setuptools/command/install_egg_info.py�initialize_options s z#install_egg_info.initialize_optionsc C s� | j d d � | j d � } t j d d | j | j � j � d } | j | _ t j j | j | � | _ | j g | _ d S)N�install_libr �egg_infoz .egg-info)�install_dirr )�set_undefined_options�get_finalized_command� pkg_resources�Distribution�egg_nameZegg_versionr �source�os�path�joinr �target�outputs)r Zei_cmd�basenamer r r �finalize_options s z!install_egg_info.finalize_optionsc C s� | j d � | j } t j j | j � r] t j j | j � r] t j | j d | j �n; t j j | j � r� | j t j | j f d | j � n | j s� t j | j � n | j | j f d | j | j f � | j � d S)Nr �dry_runz Removing zCopying %s to %s)�run_commandr r r �isdir�islinkr �remove_treer �exists�execute�unlinkr �ensure_directory�copytreer �install_namespaces)r r r r r �run s +& zinstall_egg_info.runc C s | j S)N)r )r r r r �get_outputs* s zinstall_egg_info.get_outputsc s, � f d d � } t � j � j | � d S)Nc s[ x1 d D]) } | j | � s, d | | k r d Sq W� j j | � t j d | | � | S)N�.svn/�CVS/�/zCopying %s to %s)r, r- )� startswithr �appendr �debug)�src�dst�skip)r r r �skimmer/ s z*install_egg_info.copytree.<locals>.skimmer)r r r )r r5 r )r r r( - s zinstall_egg_info.copytreec C s | j � } | s d St j j | j � \ } } | d 7} | j j | � t j d | � | j st | d � } x | D]w } t | � } t | j d � � } d } d | k r� d d j | d d � � | d f } n | j d t � � qz W| j � n d S)Nz -nspkg.pthz Installing %sZwt�.� z(; m and setattr(sys.modules[%r], %r, m) � a7 import sys,types,os; p = os.path.join(sys._getframe(1).f_locals['sitedir'], *%(pth)r); ie = os.path.exists(os.path.join(p,'__init__.py')); m = not ie and sys.modules.setdefault(%(pkg)r,types.ModuleType(%(pkg)r)); mp = (m or []) and m.__dict__.setdefault('__path__',[]); (p not in mp) and mp.append(p)%(trailer)s���r9 )�_get_all_ns_packagesr r �splitextr r r0 r �infor �open�str�tuple�splitr �write�locals�close)r �nsp�filename�ext�f�pkg�pth�trailerr r r r) S s( 'z#install_egg_info.install_namespacesc C sv i } xS | j j p g D]? } | j d � } x'