a [Îdg»ã@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 |ƒ‚dS) Nr z setup.cfgÚglobalz distutils.cfgÚuserÚposixÚ.Úz~/%spydistutils.cfgz7config_file() type must be 'local', 'global', or 'user') ÚosÚpathÚjoinÚdirnameÚ distutilsÚ__file__ÚnameÚ expanduserrÚ ValueError)ÚkindÚdot©rúC/usr/local/lib/python3.9/site-packages/setuptools/command/setopt.pyr sÿÿrFc Cs<t d|¡t ¡}| |g¡| ¡D]Æ\}}|durRt d||¡| |¡q(| |¡stt d||¡|  |¡| ¡D]p\}}|durÌt d|||¡|  ||¡|  |¡sìt d||¡| |¡q|t d||||¡|  |||¡q|q(t d|¡|s8t |dƒ}| |¡Wdƒn1s.0YdS) NzReading configuration from %szDeleting 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Ú configparserZRawConfigParserÚreadÚitemsÚinfoZremove_sectionZ has_sectionZ add_sectionZ remove_optionÚoptionsÚsetÚopenÚwrite) ÚfilenameZsettingsÚdry_runZoptsÚsectionr#ÚoptionÚvalueÚfrrrr s>     þ  ÿ þ  rc@s,eZdZgd¢ZddgZdd„Zdd„ZdS) r))ú global-configÚgz0save options to the site-wide distutils.cfg file)ú user-configÚuz7save options to the current user's pydistutils.cfg file)z filename=r,z-configuration file to use (default=setup.cfg)r-r/cCsd|_d|_d|_dS©N)Ú global_configÚ user_configr'©ÚselfrrrÚinitialize_options[szoption_base.initialize_optionscCsvg}|jr| tdƒ¡|jr,| tdƒ¡|jdurB| |j¡|sT| tdƒ¡t|ƒdkrjtd|ƒ‚|\|_dS)Nr r r éz/Must specify only one configuration file option)r2Úappendrr3r'Úlenr)r5Ú filenamesrrrÚfinalize_options`s   þzoption_base.finalize_optionsN)Ú__name__Ú __module__Ú __qualname__Ú user_optionsÚboolean_optionsr6r;rrrrrKs  ÿrc@sBeZdZdZgd¢ejZejdgZdd„Zdd„Zdd „Z d S) r z1set 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 valuerDcCs&t |¡d|_d|_d|_d|_dSr1)rr6Úcommandr*Ú set_valuerDr4rrrr6€s  zsetopt.initialize_optionscCsBt |¡|jdus|jdur&tdƒ‚|jdur>|js>tdƒ‚dS)Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)rr;rFr*rrGrDr4rrrr;‡s  zsetopt.finalize_optionscCs*t|j|j|j dd¡|jii|jƒdS)Nú-Ú_)rr'rFr*ÚreplacerGr(r4rrrÚrunŽs ÿüz setopt.runN) r<r=r>Ú descriptionrr?r@r6r;rKrrrrr rsû r )r )F)Zdistutils.utilrrrZdistutils.errorsrrrZ setuptoolsrÚ__all__rrrr rrrrÚs      +'