HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/virtualenv/config/__pycache__/ini.cpython-310.pyc
o

;jn�@s�ddlmZddlZddlZddlmZddlmZddlm	Z	m
Z
ddlmZddl
m
Z
e	rBdd	lmZdd
lmZddl
mZe�e�ZGdd
�d
�ZdS)�)�annotationsN)�ConfigParser)�Path)�
TYPE_CHECKING�ClassVar)�user_config_dir�)�convert)�Mapping)�Any)�TypeDatac@sjeZdZUdZded<dddd�Zded	<d
Zd d!dd�Zd"dd�Zd#dd�Z	d$dd�Z
ed%dd��ZdS)&�	IniConfigZVIRTUALENV_CONFIG_FILEz
ClassVar[str]�VIRTUALENV_CONFIG_FILE_ENV_VARzfailed to parseZactive�missing)NTFz ClassVar[dict[bool | None, str]]�STATE�
virtualenvN�env�Mapping[str, str] | None�return�Nonec
Cs|durtjn|}|�|jd�}|du|_|dur$ttddd��d}nt|�}||_i|_d}d|_	z|j�
�|_	WntyO}z|}WYd}~n5d}~ww|j	r�|j��|_t
�|_z|��|j�|j�|_Wnty}z|}WYd}~nd}~ww|dur�t�d||�dSdS)NrZpypa)ZappnameZ	appauthorzvirtualenv.iniz(failed to read config file %s because %r)�os�environ�getr�
is_env_varrr�config_file�_cache�has_config_file�exists�OSError�resolver�
config_parser�_loadZhas_section�section�has_virtualenv_section�	Exception�LOGGER�error)�selfrr�	exception�exc�r*�I/opt/saltstack/salt/lib/python3.10/site-packages/virtualenv/config/ini.py�__init__s:
�����zIniConfig.__init__cCs@|jjddd��}|j�|�Wd�S1swYdS)NZrtzutf-8)�encoding)r�openr Z	read_file)r'Zfile_handlerr*r*r+r!9s
$�zIniConfig._load�key�str�as_typer�tuple[Any, str] | NonecCsr||f}||jvr|j|Szd}|j�|j|���}t|||�}||f}Wnty1d}Ynw||j|<|S)N�file)rr rr"�lowerr	r$)r'r/r1Z	cache_key�source�	raw_value�value�resultr*r*r+r=s

�
z
IniConfig.get�boolcCst|j�o	t|j�S�N)r9rr#�r'r*r*r+�__bool__KszIniConfig.__bool__c	Cs4d|j�d|j|j�d|jrdnd�d|j�d�	S)Nz
config file � z (change�d�z
 via env var �))rrrrrr;r*r*r+�epilogNs���zIniConfig.epilogr:)rrrr)rr)r/r0r1rrr2)rr9)rr0)
�__name__�
__module__�__qualname__r�__annotations__rr"r,r!rr<�propertyrAr*r*r*r+r
s



r
)�
__future__r�loggingrZconfigparserr�pathlibr�typingrrZplatformdirsrr	�collections.abcr
rr�	getLoggerrBr%r
r*r*r*r+�<module>s