a „oe?ã@sˆddlmZddlmZddlmZddlZddlZddlZddlm Z gd¢Z ddd „Z dd d „Z Gd d„de ƒZ Gdd„de ƒZdS)é)Ú convert_path)Úlog)ÚDistutilsOptionErrorN)ÚCommand)Ú config_fileÚ edit_configÚ option_baseÚsetoptÚlocalcCsh|dkr dS|dkr,tj tj tj¡d¡S|dkrZtjdkrBdpDd}tj td |ƒ¡St d |ƒ‚d S) zGet 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)ÚkindÚdot©rú:C:\Program Files\Certbot\pkgs\setuptools\command\setopt.pyr srFc CsFt d|¡t ¡}dd„|_| |g¡| ¡D]Æ\}}|dur\t d||¡| |¡q2|  |¡s~t d||¡|  |¡| ¡D]p\}}|durÖt d|||¡|  ||¡|  |¡söt d||¡| |¡q†t d ||||¡|  |||¡q†q2t d |¡|sBt|d ƒ}| |¡Wdƒn1s80YdS) 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 %scSs|S©Nr)ÚxrrrÚ&ózedit_config..NzDeleting 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ÚdebugÚ configparserZRawConfigParserZ optionxformÚreadÚitemsÚinfoZremove_sectionZ has_sectionZ add_sectionZ remove_optionÚoptionsÚsetÚopenÚwrite) ÚfilenameZsettingsÚdry_runZoptsÚsectionr'ÚoptionÚvalueÚfrrrrs8        ÿ  ÿ  rc@s0eZdZdZgd¢ZddgZdd„Zdd„Zd S) rzrrrrrEsþrc@sFeZdZdZdZgd¢ejZejdgZdd„Zdd„Z d d „Z d S) r z#Save command-line options to a filez1set an option in setup.cfg or another config file))zcommand=Úczcommand to set an option for)zoption=Úoz option to set)z set-value=Úszvalue of the option)ÚremoveÚrzremove (unset) the valuerHcCs&t |¡d|_d|_d|_d|_dSr)rr9Úcommandr.Ú set_valuerHr7rrrr9ws  zsetopt.initialize_optionscCsBt |¡|jdus|jdur&tdƒ‚|jdur>|js>tdƒ‚dS)Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)rr>rJr.rrKrHr7rrrr>~s  zsetopt.finalize_optionscCs*t|j|j|j dd¡|jii|jƒdS)Nú-Ú_)rr+rJr.ÚreplacerKr,r7rrrÚrun…s ýz setopt.runN) r?r@rArBÚ descriptionrrCrDr9r>rOrrrrr isû r )r )F)Zdistutils.utilrrrZdistutils.errorsrrr#Z setuptoolsrÚ__all__rrrr rrrrÚs      )$