Your IP : 216.73.216.138


Current Path : /opt/alt/python37/lib/python3.7/site-packages/virtualenv/config/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/virtualenv/config/__pycache__/ini.cpython-37.pyc

B

���a�@s|ddlmZmZddlZddlZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZGd
d�de�ZdS)�)�absolute_import�unicode_literalsN)�user_config_dir)�PY3)�ConfigParser)�Path)�
ensure_str�)�convertc@sReZdZed�Zdddd�ZdZddd	�Zd
d�Zdd
�Z	dd�Z
edd��ZdS)�	IniConfigZVIRTUALENV_CONFIG_FILEzfailed to parseZactive�missing)NTF�
virtualenvNc
Cs|dkrtjn|}|�|jd�}|dk	|_|dk	r:t|�nttddd��d}||_i|_d}d|_	y|j�
�|_	Wn&tk
r�}z|}Wdd}~XYnbX|j	r�|j��|_t
�
�|_y|��|j�|j�|_Wn&tk
r�}z|}Wdd}~XYnX|dk	�rt�d||�dS)Nr
Zpypa)�appname�	appauthorzvirtualenv.iniz(failed to read config file %s because %r)�os�environ�get�VIRTUALENV_CONFIG_FILE_ENV_VAR�
is_env_varrr�config_file�_cache�has_config_file�exists�OSError�resolver�
config_parser�_load�has_section�section�has_virtualenv_section�	Exception�logging�error)�self�envr�	exception�exc�r'�F/opt/alt/python37/lib/python3.7/site-packages/virtualenv/config/ini.py�__init__s.


zIniConfig.__init__c	Cs8|j�d��"}t|jtrdnd�}||�WdQRXdS)N�rt�	read_file�readfp)r�open�getattrrr)r#Zfile_handler�readerr'r'r(r4szIniConfig._loadcCst||f}||jkr|j|Sy0d}|j�|j|���}t|||�}||f}Wntk
rdd}YnX||j|<|S)N�file)rrrr�lowerr
r )r#�keyZas_typeZ	cache_key�sourceZ	raw_value�value�resultr'r'r(r9s



z
IniConfig.getcCst|j�ot|j�S)N)�boolrr)r#r'r'r(�__bool__HszIniConfig.__bool__cCs,d}|�d|j|j|j|jr"dnd|j�S)Nz-{}config file {} {} (change{} via env var {})�
�d�)�formatr�STATErrr)r#�msgr'r'r(�epilogKs
zIniConfig.epilog)N)
�__name__�
__module__�__qualname__rrr<rr)rrr7�propertyr>r'r'r'r(rs
r)�
__future__rrr!rZplatformdirsrZvirtualenv.inforZvirtualenv.utilrZvirtualenv.util.pathrZvirtualenv.util.sixrr
�objectrr'r'r'r(�<module>s

?>