Ñò
6»‚Uc        
   @   s²   d  d k  l Z d  d k l Z d  d k l Z d  d k Z d  d k Z d  d k l Z d d d d	 g Z	 d
 d „ Z
 e d „ Z d e f d „  ƒ  YZ d	 e f d „  ƒ  YZ d S(   iÿÿÿÿ(   t   convert_path(   t   log(   t   DistutilsOptionErrorN(   t   Commandt   config_filet   edit_configt   option_baset   setoptt   localc         C   sš   |  d j o d S|  d j o# t  i i t  i i t i ƒ d ƒ S|  d j o8 t  i d j o d p d } t  i i t d	 | ƒ ƒ St	 d
 |  ƒ ‚ d S(   s   Get the filename of the distutils, local, global, or per-user config

    `kind` must be one of "local", "global", or "user"
    R   s	   setup.cfgt   globals   distutils.cfgt   usert   posixt   .t    s   ~/%spydistutils.cfgs7   config_file() type must be 'local', 'global', or 'user'N(
   t   ost   patht   joint   dirnamet	   distutilst   __file__t   namet
   expanduserR    t
   ValueError(   t   kindt   dot(    (    sA   /home/rpmbuild/BUILD/setuptools-18.1/setuptools/command/setopt.pyR      s    	c      	   C   sÊ  d d k  l } t i d |  ƒ | i ƒ  } | i |  g ƒ x3| i ƒ  D]%\ } } | d j o$ t i d | |  ƒ | i	 | ƒ qI | i
 | ƒ p$ t i d | |  ƒ | i | ƒ n x± | i ƒ  D]£ \ } } | d j o^ t i d | | |  ƒ | i | | ƒ | i | ƒ p$ t i d | |  ƒ | i	 | ƒ qjqÇ t i d | | | |  ƒ | i | | | ƒ qÇ WqI Wt i d	 |  ƒ | p= t |  d
 ƒ i i ƒ  }	 z |	 ~	 }
 | i |
 ƒ Wd QXn d S(   sY  Edit a configuration file to include `settings`

    `settings` is a dictionary of dictionaries or ``None`` values, keyed by
    command/section name.  A ``None`` value means to delete the entire section,
    while a dictionary lists settings to be changed or deleted in that section.
    A setting of ``None`` means to delete that setting.
    iÿÿÿÿ(   t   ConfigParsers   Reading configuration from %ss   Deleting section [%s] from %ss   Adding new section [%s] to %ss   Deleting %s.%s from %ss#   Deleting empty [%s] section from %ss   Setting %s.%s to %r in %ss
   Writing %st   wN(   t   setuptools.compatR   R   t   debugt   RawConfigParsert   readt   itemst   Nonet   infot   remove_sectiont   has_sectiont   add_sectiont   remove_optiont   optionst   sett   opent   __exit__t	   __enter__t   write(   t   filenamet   settingst   dry_runR   t   optst   sectionR&   t   optiont   valuet   _[1]t   f(    (    sA   /home/rpmbuild/BUILD/setuptools-18.1/setuptools/command/setopt.pyR       s>      	
&c           B   s;   e  Z d  Z d d d g Z d d g Z d
 „  Z d „  Z RS(   s<   Abstract base class for commands that mess with config filess   global-configt   gs0   save options to the site-wide distutils.cfg files   user-configt   us7   save options to the current user's pydistutils.cfg files	   filename=R4   s-   configuration file to use (default=setup.cfg)c         C   s   d  |  _ d  |  _ d  |  _ d  S(   N(   R    t   global_configt   user_configR,   (   t   self(    (    sA   /home/rpmbuild/BUILD/setuptools-18.1/setuptools/command/setopt.pyt   initialize_options]   s    		c         C   sÀ   g  } |  i  o | i t d ƒ ƒ n |  i o | i t d ƒ ƒ n |  i d  j	 o | i |  i ƒ n | p | i t d ƒ ƒ n t | ƒ d j o t d | ƒ ‚ n | \ |  _ d  S(   NR	   R
   R   i   s/   Must specify only one configuration file option(   R7   t   appendR   R8   R,   R    t   lenR   (   R9   t	   filenames(    (    sA   /home/rpmbuild/BUILD/setuptools-18.1/setuptools/command/setopt.pyt   finalize_optionsb   s    

(   s   global-configR5   s0   save options to the site-wide distutils.cfg file(   s   user-configR6   s7   save options to the current user's pydistutils.cfg file(   s	   filename=R4   s-   configuration file to use (default=setup.cfg)(   t   __name__t
   __module__t   __doc__t   user_optionst   boolean_optionsR:   R>   (    (    (    sA   /home/rpmbuild/BUILD/setuptools-18.1/setuptools/command/setopt.pyR   M   s      		c           B   sX   e  Z d  Z d Z d d d d g e i Z e i d g Z d „  Z d „  Z d „  Z	 RS(   s#   Save command-line options to a files1   set an option in setup.cfg or another config files   command=t   cs   command to set an option fors   option=t   os   option to sets
   set-value=t   ss   value of the optiont   removet   rs   remove (unset) the valuec         C   s5   t  i |  ƒ d  |  _ d  |  _ d  |  _ d  |  _ d  S(   N(   R   R:   R    t   commandR1   t	   set_valueRG   (   R9   (    (    sA   /home/rpmbuild/BUILD/setuptools-18.1/setuptools/command/setopt.pyR:   ‚   s
    			c         C   sl   t  i |  ƒ |  i d  j p |  i d  j o t d ƒ ‚ n |  i d  j o |  i o t d ƒ ‚ n d  S(   Ns%   Must specify --command *and* --options$   Must specify --set-value or --remove(   R   R>   RI   R    R1   R   RJ   RG   (   R9   (    (    sA   /home/rpmbuild/BUILD/setuptools-18.1/setuptools/command/setopt.pyR>   ‰   s
     c         C   s=   t  |  i h h |  i |  i i d d ƒ 6|  i 6|  i ƒ d  S(   Nt   -t   _(   R   R,   RJ   R1   t   replaceRI   R.   (   R9   (    (    sA   /home/rpmbuild/BUILD/setuptools-18.1/setuptools/command/setopt.pyt   run   s    	#(   s   command=RD   s   command to set an option for(   s   option=RE   s   option to set(   s
   set-value=RF   s   value of the option(   s   removeRH   s   remove (unset) the value(
   R?   R@   RA   t   descriptionR   RB   RC   R:   R>   RN   (    (    (    sA   /home/rpmbuild/BUILD/setuptools-18.1/setuptools/command/setopt.pyR   t   s   
		(   t   distutils.utilR    R   R   t   distutils.errorsR   R   t
   setuptoolsR   t   __all__R   t   FalseR   R   R   (    (    (    sA   /home/rpmbuild/BUILD/setuptools-18.1/setuptools/command/setopt.pyt   <module>   s   -'