ó
ñsºec           @   sX   d  Z  d Z d d l Z d d l m Z d d l m Z m Z d e f d „  ƒ  YZ d S(   s€   distutils.command.install_data

Implements the Distutils 'install_data' command, for installing
platform-independent data files.s   $Id$iÿÿÿÿN(   t   Command(   t   change_roott   convert_patht   install_datac           B   sS   e  Z d  Z d d d g Z d g Z d	 „  Z d
 „  Z d „  Z d „  Z	 d „  Z
 RS(   s   install data filess   install-dir=t   dsI   base directory for installing data files (default: installation base dir)s   root=s<   install everything relative to this alternate root directoryt   forcet   fs-   force installation (overwrite existing files)c         C   s@   d  |  _ g  |  _ d  |  _ d |  _ |  j j |  _ d |  _ d  S(   Ni    i   (   t   Nonet   install_dirt   outfilest   rootR   t   distributiont
   data_filest   warn_dir(   t   self(    (    s4   /usr/lib/python2.7/distutils/command/install_data.pyt   initialize_options   s    				c         C   s   |  j  d d d d ƒ d  S(	   Nt   installR   R   R
   R   (   R   R   (   R
   R
   (   R   R   (   t   set_undefined_options(   R   (    (    s4   /usr/lib/python2.7/distutils/command/install_data.pyt   finalize_options%   s    	c         C   sk  |  j  |  j ƒ xT|  j D]I} t | t ƒ r t | ƒ } |  j ra |  j d | |  j f ƒ n  |  j | |  j ƒ \ } } |  j	 j
 | ƒ q t | d ƒ } t j j | ƒ sÌ t j j |  j | ƒ } n |  j rê t |  j | ƒ } n  |  j  | ƒ | d g  k r|  j	 j
 | ƒ q xF | d D]: } t | ƒ } |  j | | ƒ \ } } |  j	 j
 | ƒ q%Wq Wd  S(   NsM   setup script did not provide a directory for '%s' -- installing right in '%s'i    i   (   t   mkpathR   R   t
   isinstancet   strR   R   t   warnt	   copy_fileR	   t   appendt   ost   patht   isabst   joinR
   R   (   R   R   t   outt   _t   dirt   data(    (    s4   /usr/lib/python2.7/distutils/command/install_data.pyt   run,   s*    			c         C   s   |  j  p g  S(   N(   R   (   R   (    (    s4   /usr/lib/python2.7/distutils/command/install_data.pyt
   get_inputsM   s    c         C   s   |  j  S(   N(   R	   (   R   (    (    s4   /usr/lib/python2.7/distutils/command/install_data.pyt   get_outputsP   s    (   s   install-dir=R   sI   base directory for installing data files (default: installation base dir)N(   s   root=Ns<   install everything relative to this alternate root directory(   R   R   s-   force installation (overwrite existing files)(   t   __name__t
   __module__t   descriptionR   t   user_optionst   boolean_optionsR   R   R!   R"   R#   (    (    (    s4   /usr/lib/python2.7/distutils/command/install_data.pyR      s     					!	(	   t   __doc__t   __revision__R   t   distutils.coreR    t   distutils.utilR   R   R   (    (    (    s4   /usr/lib/python2.7/distutils/command/install_data.pyt   <module>   s
   