K iddlZddlZddlmZddlmZddlZddlmZddlm Z ddl m Z gdZ dd Z dd ZGd d eZGd deZy)N)Command)_cfg_read_utf8_with_fallback)log)DistutilsOptionError) convert_path) config_file edit_config option_basesetoptc^|dk(ry|dk(rKtjjtjjtj dS|dk(rGtj dk(xrdxsd}tjjtd |d Std |) zGet the filename of the distutils, local, global, or per-user config `kind` must be one of "local", "global", or "user" localz setup.cfgglobalz distutils.cfguserposix.z~/zpydistutils.cfgz7config_file() type must be 'local', 'global', or 'user') ospathjoindirname distutils__file__name expanduserr ValueError)kinddots _/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/setuptools/command/setopt.pyr r s  w xww||BGGOOI,>,>?QQ v~gg (S.Bww!!,C5/H"IJJ NPT UUc ltjd|tj}d|_t |||j D]\}}|)tjd|||j|2|j|s(tjd|||j||j D]\}}|etjd||||j|||j|rDtjd|||j|mtjd|||||j|||tjd ||s)t|d d 5}|j|dddyy#1swYyxYw) 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 sII-x8  ' ' )D2D x0$NN,5 ? HH4gx H    (##G, 97HM  )!( 5 =II6R&&w7<<0A7H++G4II3WfeXHHWfe4 55.HH\8$  (C' 2 a JJqM     s F**F3c,eZdZdZgdZddgZdZdZy)r zz-configuration file to use (default=setup.cfg)r@rBc.d|_d|_d|_yr#) global_config user_configr7selfs rinitialize_optionszoption_base.initialize_optionsVs! r clg}|jr|jtd|jr|jtd|j|j|j|s|jtdt |dkDr t d||\|_y)Nrrrz/Must specify only one configuration file option)rEappendr rFr7lenr)rH filenamess rfinalize_optionszoption_base.finalize_options[s      [2 3      [0 1 == $   T]] +   [1 2 y>A &A9 %r N)__name__ __module__ __qualname____doc__ user_optionsboolean_optionsrIrOr$r rr r Hs%FL O  %r r cleZdZdZdZgdej zZejdgzZdZd dZ d dZ y) 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 valuerZcftj|d|_d|_d|_d|_yr#)r rIcommandr< set_valuerZrGs rrIzsetopt.initialize_optionszs,&&t,   r Nctj||j |j t d|j |j s t dyy)Nz%Must specify --command *and* --optionz$Must specify --set-value or --remove)r rOr]r<rr^rZrGs rrOzsetopt.finalize_optionssS$$T* << 4;;#6&'NO O >> !$++&'MN N+6 !r ct|j|j|jj dd|j ii|j y)N-_)r r7r]r<replacer^r9rGs rrunz setopt.runs> MM \\DKK//S94>>J K LL r )returnN) rPrQrRrS descriptionr rTrUrIrOrdr$r rr r lsE-EK   !L"11XJ>OO r r )r)F)r*rrr unicode_utilsrrrdistutils.errorsrdistutils.utilr__all__r r r r r$r rrksG 81' A V'T!%'!%H! [! r