
    d                    D    d dl mZ d dlmZ d dlmZ  G d d          ZdS )    )annotations)CleoValueError)	Componentc                  (    e Zd ZdddZdd	ZddZdS )UIN
componentslist[Component] | NonereturnNonec                P    i | _         |g }|D ]}|                     |           d S N)_componentsregister)selfr   	components      N/home/feoh/.local/pipx/venvs/poetry/lib/python3.11/site-packages/cleo/ui/ui.py__init__zUI.__init__   sC    13J# 	% 	%IMM)$$$$	% 	%    r   r   c                    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   s     r   r   zUI.register   sZ    )Y// 	 G   ~ 	H !FGGG+4(((r   r   strc                T    || j         vrt          d| d          | j         |         S )NzUI component "z" does not exist.)r   r   )r   r   s     r   r   zUI.component   s8    t''' !I$!I!I!IJJJ%%r   r   )r   r	   r
   r   )r   r   r
   r   )r   r   r
   r   )__name__
__module____qualname__r   r   r    r   r   r   r      sU        % % % % %	5 	5 	5 	5& & & & & &r   r   N)
__future__r   cleo.exceptionsr   cleo.ui.componentr   r   r   r   r   <module>r!      sm    " " " " " " * * * * * * ' ' ' ' ' '& & & & & & & & & &r   