o
    Vh                     @  sD   d dl mZ d dlmZ d dlmZ d dlmZ G dd deZdS )    )annotations)Any)ConfigSource)PropertyNotFoundErrorc                   @  sB   e Zd ZdddZedddZdddZdddZdddZdS )DictConfigSourcereturnNonec                 C  s
   i | _ d S N_configself r   t/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/poetry/config/dict_config_source.py__init__
   s   
zDictConfigSource.__init__dict[str, Any]c                 C  s   | j S r	   r
   r   r   r   r   config   s   zDictConfigSource.configkeystrr   c                 C  sh   | d}| j}t|D ]%\}}||vrtdd| d|t|d kr-||   S || }qd S )N.zKey z not in config   )splitr   	enumerater   joinlenr   r   keysr   ir   r   r   get_property   s   

zDictConfigSource.get_propertyvaluec                 C  sl   | d}| j}t|D ]'\}}||vr |t|d k r i ||< |t|d kr/|||<  d S || }qd S Nr   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   add_property   s   

zDictConfigSource.add_propertyc                 C  sX   | d}| j}t|D ]\}}||vr d S |t|d kr%||=  d S || }qd S r    r!   r   r   r   r   remove_property,   s   

z DictConfigSource.remove_propertyN)r   r   )r   r   )r   r   r   r   )r   r   r   r   r   r   )r   r   r   r   )	__name__
__module____qualname__r   propertyr   r   r"   r#   r   r   r   r   r   	   s    


r   N)
__future__r   typingr   poetry.config.config_sourcer   r   r   r   r   r   r   <module>   s
    