U l a@sddlmZddlmZddlmZddlZddlZddlmZddl m Z ddd d gZ dd dZ dddZ Gdd d e ZGdd d eZdS)) convert_path)log)DistutilsOptionErrorN) configparser)Command config_file edit_config option_basesetoptlocalcCsh|dkr dS|dkr,tjtjtjdS|dkrZtjdkrBdpDd}tjtd |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.cfgglobalz distutils.cfguserposix.z~/%spydistutils.cfgz7config_file() type must be 'local', 'global', or 'user'N) ospathjoindirname distutils__file__name expanduserr ValueError)kinddotrZC:\Users\vtejo\AppData\Local\Temp\pip-unpacked-wheel-wx4infiz\setuptools\command\setopt.pyrs Fc Cs&td|t}||g|D]\}}|dkrRtd||||q(||sttd||| ||D]p\}}|dkrtd|||| ||| |std||||q|td||||| |||q|q(td||s"t |d }||W5QRXdS) 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 %sw)rdebugrRawConfigParserreaditemsinforemove_section has_section add_section remove_optionoptionssetopenwrite) filenamesettingsdry_runoptssectionr(optionvaluefrrrr!sJ          c@s2eZdZdZdddgZddgZddZd d Zd S) r z|js>tddS)Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)r rBrNr1rrOrLr;rrrrBs  zsetopt.finalize_optionscCs*t|j|j|jdd|jii|jdS)N-_)rr,rNr1replacerOr.r;rrrrunsz setopt.runN) rCrDrErF descriptionr rGrHr=rBrSrrrrr ss )r )F)distutils.utilrrrdistutils.errorsrrZsetuptools.extern.six.movesr setuptoolsr__all__rrr r rrrrs        +'