3 ÄvhÝã@s�ddlmZddlmZddlmZddlZddlZddlmZddl m Z ddd d gZ dd d„Z ddd„Z Gdd „d e ƒZGdd „d eƒZdS)é)Ú convert_path)Úlog)ÚDistutilsOptionErrorN)Ú configparser)ÚCommandÚ config_fileÚ edit_configÚ option_baseÚsetoptÚlocalcCsh|dkr dS|dkr,tjjtjjtjƒdƒS|dkrZtjdkrBdpDd}tjjtd |ƒƒSt d |ƒ‚d S) z�Get the filename of the distutils, local, global, or per-user config `kind` must be one of "local", "global", or "user" r z setup.cfgÚglobalz distutils.cfgÚuserÚposixÚ.Úz~/%spydistutils.cfgz7config_file() type must be 'local', 'global', or 'user'N) ÚosÚpathÚjoinÚdirnameÚ distutilsÚ__file__ÚnameÚ expanduserrÚ ValueError)ZkindÚdot©rú/usr/lib/python3.6/setopt.pyrsFc Cs.tjd|ƒtjƒ}|j|gƒxÖ|jƒD]Ê\}}|dkrTtjd||ƒ|j|ƒq*|j|ƒsvtjd||ƒ|j |ƒx||jƒD]p\}}|dkrÐtjd|||ƒ|j ||ƒ|j |ƒsðtjd||ƒ|j|ƒq€tjd||||ƒ|j |||ƒq€Wq*Wtjd|ƒ|�s*t |d ƒ�}|j|ƒWdQRXdS) aYEdit 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. zReading configuration from %sNzDeleting section [%s] from %szAdding new section [%s] to %szDeleting %s.%s from %sz#Deleting empty [%s] section from %szSetting %s.%s to %r in %sz Writing %sÚw)rÚdebugrZRawConfigParserÚreadÚitemsÚinfoZremove_sectionZ has_sectionZ add_sectionZ remove_optionÚoptionsÚsetÚopenÚwrite) ÚfilenameZsettingsÚdry_runZoptsZsectionr"ÚoptionÚvalueÚfrrrr!s8            c@s2eZdZdZdddgZddgZd d „Zd d„ZdS)r zr?Ú descriptionr r@rAr6r;rSrrrrr ss )r )F)Zdistutils.utilrrrZdistutils.errorsrrZsetuptools.extern.six.movesrZ setuptoolsrÚ__all__rrr r rrrrÚs        +'