HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/virtualenv/config/__pycache__/ini.cpython-310.pyc
o

3�h�
�@stddlmZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlmZe�
e�ZGd	d
�d
�ZdS)�)�annotationsN)�ConfigParser)�Path)�ClassVar)�user_config_dir�)�convertc@sdeZdZUdZded<dddd�Zded	<d
Zdddd�Zdd�Zdd�Z	ddd�Z
edd��ZdS)�	IniConfig�VIRTUALENV_CONFIG_FILEz
ClassVar[str]�VIRTUALENV_CONFIG_FILE_ENV_VARzfailed to parse�active�missing)NTFz ClassVar[dict[bool | None, str]]�STATE�
virtualenvN�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)Nr�pypa)�appname�	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�_load�has_section�section�has_virtualenv_section�	Exception�LOGGER�error)�self�envr�	exception�exc�r+�@/usr/local/lib/python3.10/dist-packages/virtualenv/config/ini.py�__init__s:
�����zIniConfig.__init__cCs@|jjddd��}|j�|�Wd�S1swYdS)N�rtzutf-8)�encoding)r�openr�	read_file)r'�file_handlerr+r+r,r 3s
$�zIniConfig._loadcCsr||f}||jvr|j|Szd}|j�|j|���}t|||�}||f}Wnty1d}Ynw||j|<|S)N�file)rrrr"�lowerrr$)r'�key�as_type�	cache_key�source�	raw_value�value�resultr+r+r,r7s

�
z
IniConfig.get�boolcCst|j�o	t|j�S�N)r<rr#�r'r+r+r,�__bool__EszIniConfig.__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,�epilogHs���zIniConfig.epilogr=)rr)rr<)
�__name__�
__module__�__qualname__r�__annotations__rr"r-r rr?�propertyrDr+r+r+r,r	s

r	)�
__future__r�loggingr�configparserr�pathlibr�typingr�platformdirsrr�	getLoggerrEr%r	r+r+r+r,�<module>s