U 巀g6@s>dZddlZddlZddlZddlZddlmZmZmZm Z m Z m Z m Z ddl mZmZddlmZddlmZddlmZddlmZmZejZe d eZerd nd Zd Zed dddddZejej ej!ej"ej#fZ$ej ejej!fZ%ee&Z'eedddZ(ee edddZ)eee efdddZ*GdddZ+dS)a Configuration management setup Some terminology: - name As written in config files. - value Value associated with a name - key Name combined with it's section (section.name) - variant A single word describing where the configuration key-value pair came from N)AnyDictIterableListNewTypeOptionalTuple)ConfigurationError!ConfigurationFileCouldNotBeLoaded)appdirs)WINDOWS) getLogger) ensure_direnumKindzpip.inizpip.conf)versionhelpuserglobalsiteenvzenv-var)USERGLOBALSITEENVENV_VAR)namereturncCs*|dd}|dr&|dd}|S)zAMake a name consistent regardless of source (environment or file)_-z--N)lowerreplace startswith)rr$I/opt/hc_python/lib/python3.8/site-packages/pip/_internal/configuration.py_normalize_name2s  r&cCs(d|krd|d}t||ddS)N.zVKey does not contain dot separated section and key. Perhaps you wanted to use 'global.z ' instead?)r split)r error_messager$r$r%_disassemble_key:s  r+rcCstddtdD}tjtjt}tjtjdt rEsz+get_configuration_files..pip~z.pip)r site_config_dirsr-r.r/sysprefixr0 expanduserr user_config_dirkindsrrr)global_config_filessite_config_filelegacy_config_filenew_config_filer$r$r%get_configuration_filesDs"  r?cseZdZdZd6eeeddfdd ZddddZee dd d Z e e e e fdd d Ze e d ddZe e ddddZe dd ddZddddZddddZeee e fdddZddddZee edddZe ed d!d"Zddd#d$Ze e e e e fee e fd%d&d'Ze e e e fdd(d)Ze e eee fdd*d+Zeee e fd,d-d.Z e e efdd/d0Z!e edd1d2d3Z"e dd4d5Z#Z$S)7 ConfigurationaHandles management of configuration. Provides an interface to accessing and managing configuration files. This class converts provides an API that takes "section.key-name" style keys and stores the value associated with it as "key-name" under the section "section". This allows for a clean interface wherein the both the section and the key-name are preserved in an easy to manage form in the configuration files and the data stored is also nice. N)isolated load_onlyrcsjt|dk r4|tkr4tddttt||_||_ ddt D|_ ddt D|_ g|_ dS)Nz5Got invalid value for load_only - should be one of {}z, cSsi|] }|gqSr$r$r1variantr$r$r% rsz*Configuration.__init__..cSsi|] }|iqSr$r$rCr$r$r%rEus)super__init__VALID_LOAD_ONLYr formatr/mapreprrArBOVERRIDE_ORDER_parsers_config_modified_parsers)selfrArB __class__r$r%rGes  zConfiguration.__init__r,cCs||js|dS)zs  zConfiguration.get_environ_varsccstjdd}t}tj|tjfV|j o>|os8 $