관리-도구
편집 파일: install_egg_info.cpython-34.pyc
� h f" � @ s� d 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 d � Z d d � Z d d � Z d S) z�distutils.command.install_egg_info Implements the Distutils 'install_egg_info' command, for installing a package's PKG-INFO metadata.� )�Command)�log�dir_utilNc @ sU e Z d Z d Z d Z d g Z d d � Z d d � Z d d � Z d d � Z d S)�install_egg_infoz)Install an .egg-info file for the packagez8Install package's PKG-INFO metadata as an .egg-info file�install-dir=�d�directory to install toc C s d | _ d S)N)�install_dir)�self� r �G/opt/alt/python34/lib64/python3.4/distutils/command/install_egg_info.py�initialize_options s z#install_egg_info.initialize_optionsc C s� | j d d � d t t | j j � � � t t | j j � � � t j d d � f } t j j | j | � | _ | j g | _ d S)NZinstall_libr z%s-%s-py%s.egg-info� )�install_dirr )Zset_undefined_options�to_filename� safe_name�distributionZget_name�safe_versionZget_version�sys�version�os�path�joinr �target�outputs)r �basenamer r r �finalize_options s z!install_egg_info.finalize_optionsc C s | j } t j j | � rG t j j | � rG t j | d | j �np t j j | � r| | j t j | j f d | � n; t j j | j � s� | j t j | j f d | j � n t j d | � | j st | d d d �� } | j j j | � Wd QXn d S)N�dry_runz Removing z Creating z Writing %s�w�encodingzUTF-8)r r r �isdir�islinkr Zremove_treer �existsZexecute�unlinkr �makedirsr �info�openr ZmetadataZwrite_pkg_file)r r �fr 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_outputsN)r r r ) �__name__� __module__�__qualname__�__doc__ZdescriptionZuser_optionsr r r( r) r r r r r s r c C s t j d d | � S)z�Convert an arbitrary string to a standard distribution name Any runs of non-alphanumeric/. characters are replaced with a single '-'. z[^A-Za-z0-9.]+�-)�re�sub)�namer r r r 6 s r c C s% | j d d � } t j d d | � S)z�Convert an arbitrary string to a standard version string Spaces become dots, and all other non-alphanumeric characters become dashes, with runs of multiple dashes condensed to a single dash. � �.z[^A-Za-z0-9.]+r. )�replacer/ r0 )r r r r r >