
    d~                    ^    d dl mZ d dlZd dlmZ d dlmZ erd dlmZ  G d de          Z	dS )    )annotationsN)TYPE_CHECKING)Question)IOc                  8     e Zd ZdZ	 dd fdZddZddZ xZS )ConfirmationQuestionz'
    Represents a yes/no question.
    T(?i)^yquestionstrdefaultbooltrue_answer_regexreturnNonec                r    t                                          ||           || _        | j        | _        d S )N)super__init___true_answer_regex_default_normalizer_normalizer)selfr
   r   r   	__class__s       a/home/feoh/.local/pipx/venvs/poetry/lib/python3.11/site-packages/cleo/ui/confirmation_question.pyr   zConfirmationQuestion.__init__   s8     	7+++"33    ior   c                ^    d| j          d| j        rdnd d}|                    |           d S )Nz
<question>z (yes/no)</> [<comment>yesnoz</>] )	_question_defaultwrite_error)r   r   messages      r   _write_promptz"ConfirmationQuestion._write_prompt   sW    A A A"&-9TA A A 	
 	wr   answerc                    t          |t                    r|S t          j        | j        |          du}| j        du r|r|pdS | p|S )z,
        Default answer normalizer.
        NF)
isinstancer   rematchr   r   )r   r$   answer_is_trues      r   r   z(ConfirmationQuestion._default_normalizer#   s^     fd## 	M$"96BB$N<5  -~7%7z+^+r   )Tr	   )r
   r   r   r   r   r   r   r   )r   r   r   r   )r$   r   r   r   )__name__
__module____qualname____doc__r   r#   r   __classcell__)r   s   @r   r   r      s{         
 MU4 4 4 4 4 4 4       , , , , , , , ,r   r   )

__future__r   r'   typingr   cleo.ui.questionr   
cleo.io.ior   r    r   r   <module>r4      s    " " " " " " 				             % % % % % %   ,  ,  ,  ,  ,8  ,  ,  ,  ,  ,r   