� �fc @ s� d d l m Z d d l m Z d d l m Z d d l Z d d l Z d d l m Z d d l m 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 configparser( t Commandt config_filet edit_configt option_baset setoptt localc C s� | d k r d S| d k r> t j j t j j t j � d � S| d k r t j d k r_ d pb d } t j j t d | � � St 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( ( s= /usr/lib/python2.7/site-packages/setuptools/command/setopt.pyR s c C s� t j d | � t j � } | j | g � x+| j � D]\ } } | d k rt t j d | | � | j | � q9 | j | � s� t j d | | � | j | � n x� | j � D]� \ } } | d k r&t j d | | | � | j | | � | j | � sRt j d | | � | j | � qRq� t j d | | | | � | j | | | � q� Wq9 Wt j d | � | s�t | d � � } | j | � 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. s 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( R t debugR t RawConfigParsert readt itemst Nonet infot remove_sectiont has_sectiont add_sectiont remove_optiont optionst sett opent write( t filenamet settingst dry_runt optst sectionR% t optiont valuet f( ( s= /usr/lib/python2.7/site-packages/setuptools/command/setopt.pyR ! s8 c B s; e Z d Z d d d g Z d d g Z d � Z d � Z RS( s<