\bgddlZddlZddlmZddlmZddlZddlmZddlm Z ddl m Z gdZ dd Z dd ZGd deZGddeZdS)N)Command)_cfg_read_utf8_with_fallback)log)DistutilsOptionError) convert_path) 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 j/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/setuptools/command/setopt.pyr r s  w{ xw||BGOOI,>??QQQ v~~g (S.Bw!!,/Ds/J"K"KLLL NPT U UUFc tjd|tj}d|_t |||D]-\}}|,tjd||||4| |s+tjd||| ||D]\}}|ntjd|||| ||| |s+tjd||||utjd||||| |||/tjd ||sBt|d 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) optionstrs rzedit_config..(sr 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 %swzutf-8)encoding)rdebug configparserRawConfigParser optionxformritemsinforemove_section has_section add_section remove_optionoptionssetopenwrite) filenamesettingsdry_runoptssectionr3optionvaluefs rr r sKI-x888  ' ) )D22D x000$NN,,55 ? H4gx H H H    ( ( ( (##G,, * 97HMMM  )))!( 5 5 =I6RRR&&w777<<005A7H++G444I3WfeXHHWfe4444 5H\8$$$  (C' 2 2 2 a JJqMMM                  s-GGGc.eZdZdZgdZddgZdZdZdS)r zz-configuration file to use (default=setup.cfg)r@rBc0d|_d|_d|_dSr#) global_config user_configr7selfs rinitialize_optionszoption_base.initialize_optionsVs! r cg}|jr"|td|jr"|td|j||j|s"|tdt |dkrt d||\|_dS)Nrrr z/Must specify only one configuration file option)rEappendr rFr7lenr)rH filenamess rfinalize_optionszoption_base.finalize_options[s   4   [22 3 3 3   2   [00 1 1 1 = $   T] + + + 3   [11 2 2 2 y>>A  &A9 %r N)__name__ __module__ __qualname____doc__ user_optionsboolean_optionsrIrOr$r rr r HsXFFL O  %%%%%r r cZeZdZdZdZgdejzZejdgzZdZd dZ d d Z 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 valuerZcrt|d|_d|_d|_d|_dSr#)r rIcommandr< set_valuerZrGs rrIzsetopt.initialize_optionszs6&&t,,,   r returnNct||j|jt d|j|jst ddSdS)Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)r rOr]r<rr^rZrGs rrOzsetopt.finalize_optionss`$$T*** < 4;#6&'NOO O > !$+ !&'MNN N " ! ! !r ct|j|j|jdd|jii|jdS)N-_)r r7r]r<replacer^r9rGs rrunz setopt.runsK M \DK//S994>J K L     r )r_N) rPrQrRrS descriptionr rTrUrIrOrer$r rr r ls--EK  !L"1XJ>OOOOO      r r )r )F)r*rrr unicode_utilsrrrdistutils.errorsrdistutils.utilr__all__r r r r r$r rrks 888888111111'''''' A A A V V V V''''T!%!%!%!%!%'!%!%!%H! ! ! ! ! [! ! ! ! ! r