JdddlmZddlmZddlmZddlZddlZddlZddlm Z gdZ ddZ dd Z Gd d e Z Gd de ZdS)) convert_path)log)DistutilsOptionErrorN)Command) config_file edit_config option_basesetoptlocalc^|dkrdS|dkrGtjtjtjdS|dkrCtjdkrdpd}tjtd |zStd |) 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') ospathjoindirname distutils__file__name expanduserr ValueError)kinddots L/opt/alt/python311/lib/python3.11/site-packages/setuptools/command/setopt.pyrr s  w{ xw|| GOOI. / /    v~~g (S.Bw!!,/Ds/J"K"KLLL A4  Fc tjd|tj}d|_||g|D]-\}}|,tjd||||4| |s+tjd||| ||D]\}}|ntjd|||| ||| |s+tjd||||utjd||||| |||/tjd ||s@t|d 5}||ddddS#1swxYwYdSdS) 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 %sc|SN)xs rzedit_config..*srNzDeleting 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)rdebug configparserRawConfigParser optionxformreaditemsinforemove_section has_section add_section remove_optionoptionssetopenwrite) filenamesettingsdry_runoptssectionr1optionvaluefs rrr sRI-x888  ' ) )D"{DIIxj$NN,,55 ? H4gx H H H    ( ( ( (##G,, * 97HMMM  )))!( 5 5 =I0&&w777<<005!F!((444++G444I3HHWfe4444! 5$H\8$$$  (C  A JJqMMM                  s1GGGc.eZdZdZgdZddgZdZdZdS)r zr@c0d|_d|_d|_dSr!) global_config user_configr5selfs rinitialize_optionszoption_base.initialize_options\s! rcg}|jr"|td|jr"|td|j||j|s"|tdt |dkrt d||\|_dS)Nr rr z/Must specify only one configuration file option)rCappendrrDr5lenr)rF filenamess rfinalize_optionszoption_base.finalize_optionsas   4   [22 3 3 3   2   [00 1 1 1 = $   T] + + + 3   [11 2 2 2 y>>A  &A # rN)__name__ __module__ __qualname____doc__ user_optionsboolean_optionsrGrMr"rrr r LsWFFL O #####rr cVeZdZdZdZgdejzZejdgzZdZdZ dZ dS) 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)removerzremove (unset) the valuerXcrt|d|_d|_d|_d|_dSr!)r rGcommandr: set_valuerXrEs rrGzsetopt.initialize_optionss6&&t,,,   rct||j|jt d|j|jst ddSdS)Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)r rMr[r:rr\rXrEs rrMzsetopt.finalize_optionss`$$T*** < 4;#6&'NOO O > !$+ !&'MNN N " ! ! !rct|j|j|jdd|jii|jdS)N-_)rr5r[r:replacer\r7rEs rrunz setopt.runsO M t{223<OOOO     rr )r )F)distutils.utilrrrdistutils.errorsrrr' setuptoolsr__all__rrr r r"rrrhs''''''111111  A A A&))))X$#$#$#$#$#'$#$#$#N" " " " " [" " " " " r