o
    Uh!                     @  sJ   d dl mZ d dlZd dlZd dlmZ eeZG dd dZ	dgZ
dS )    )annotationsN)OrderedDictc                   @  sx   e Zd ZdddZedd Zedd Zed	d
 Zdd Z	dd Z
dddZdd ZdddZdd ZdddZdS )PyEnvCfgreturnNonec                 C  s   || _ || _d S N)contentpath)selfr   r	    r   o/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/virtualenv/create/pyenv_cfg.py__init__   s   
zPyEnvCfg.__init__c                 C  s   |  |d S )Nz
pyvenv.cfg)	from_file)clsfolderr   r   r   from_folder   s   zPyEnvCfg.from_folderc                 C  s"   |  r	| |nt }t||S r   )exists_read_valuesr   r   )r   r	   r   r   r   r   r      s   
zPyEnvCfg.from_filec                 C  sV   t  }| jdd D ]}|d}|d |  }||d d   }|||< q|S )Nutf-8encoding=   )r   	read_text
splitlinesindexstrip)r	   r   line	equals_atkeyvaluer   r   r   r      s   

zPyEnvCfg._read_valuesc                 C  s   t d| j d}| j D ])\}}|r tj|r tj|n|}| d| }t d| ||7 }|d7 }q| jj|dd d S )Nzwrite %s z = z	%s
r   r   )	LOGGERdebugr	   r   itemsosr   realpath
write_text)r
   textr   r    normalized_valuer   r   r   r   write"   s    
zPyEnvCfg.writec                 C  s   |  | j| _| jS r   )r   r	   r   r
   r   r   r   refresh-   s   zPyEnvCfg.refreshc                 C  s   || j |< d S r   r   )r
   r   r    r   r   r   __setitem__1   s   zPyEnvCfg.__setitem__c                 C  s
   | j | S r   r.   )r
   r   r   r   r   __getitem__4      
zPyEnvCfg.__getitem__boolc                 C  s
   || j v S r   r.   )r
   itemr   r   r   __contains__7   r1   zPyEnvCfg.__contains__c                 C  s   | j | | S r   )r   update)r
   otherr   r   r   r5   :   s   zPyEnvCfg.updatestrc                 C  s   | j j d| j dS )Nz(path=))	__class____name__r	   r,   r   r   r   __repr__>   s   zPyEnvCfg.__repr__N)r   r   )r   r2   )r   r7   )r:   
__module____qualname__r   classmethodr   r   staticmethodr   r+   r-   r/   r0   r4   r5   r;   r   r   r   r   r   
   s    



	

r   )
__future__r   loggingr&   collectionsr   	getLoggerr:   r#   r   __all__r   r   r   r   <module>   s    
9