o
    Vh                     @  s6   d dl mZ d dlmZ d dlmZ G dd dZdS )    )annotations)CleoValueError)	Componentc                   @  s,   e Zd ZddddZdd
dZdddZdS )UIN
componentslist[Component] | NonereturnNonec                 C  s"   i | _ |pg D ]}| | qd S N)_componentsregister)selfr   	component r   ^/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/cleo/ui/ui.py__init__   s   zUI.__init__r   r   c                 C  s0   t |ts	td|jstd|| j|j< d S )Nz5A UI component must inherit from the Component class.z#A UI component cannot be anonymous.)
isinstancer   r   namer   )r   r   r   r   r   r      s   
zUI.registerr   strc                 C  s$   || j vrtd| d| j | S )NzUI component "z" does not exist.)r   r   )r   r   r   r   r   r      s   

zUI.componentr
   )r   r   r   r	   )r   r   r   r	   )r   r   r   r   )__name__
__module____qualname__r   r   r   r   r   r   r   r      s    
r   N)
__future__r   cleo.exceptionsr   cleo.ui.componentr   r   r   r   r   r   <module>   s    