a c@sddlmZddlmZddlmZddlZddlZddlmZddl m Z gdZ dd d Z dd d Z Gddde ZGdddeZdS)) 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)kinddotrf/workspaces/shunt/resources/test-fastapi/venv/lib/python3.9/site-packages/setuptools/command/setopt.pyrsrFc Cs<td|t}||g|D]\}}|durRtd||||q(||sttd||| ||D]p\}}|durtd|||| ||| |std||||q|td||||| |||q|q(td||s8t |d }||Wdn1s.0YdS) 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!s>          rc@s0eZdZdZgdZddgZddZddZd 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;rrrruns z setopt.runN) rCrDrErF descriptionr rGrHr=rBrSrrrrr ss r )r )F)distutils.utilrrrdistutils.errorsrrZsetuptools.extern.six.movesr setuptoolsr__all__rrr r rrrrs       +'