
    ,jib                         S SK Jr  S SK Jr  S SK Jr  S SK Jr  S SKJr  S SKJr   " S S\5      r	S	\S
S4S jr
 " S S5      rg)    )Any)Dict)
NamedTuple)Sequence)DEFAULT_KBI_MESSAGE)Questionc                   .    \ rS rSr% Sr\\S'   \\S'   Srg)	FormField
   z
Represents a question within a form

Args:
    key: The name of the form field.
    question: The question to ask in the form field.
keyquestion N)	__name__
__module____qualname____firstlineno____doc__str__annotations__r   __static_attributes__r       J/home/james-whalen/.local/lib/python3.13/site-packages/questionary/form.pyr
   r
   
   s     
Hr   r
   kwargsreturnFormc                  <    [        S U R                  5        5       6 $ )zCreate a form with multiple questions.

The parameter name of a question will be the key for the answer in
the returned dict.

Args:
    kwargs: Questions to ask in the form.
c              3   <   #    U  H  u  p[        X5      v   M     g 7fN)r
   ).0kqs      r   	<genexpr>form.<locals>.<genexpr>    s     =nda)A//ns   )r   items)r   s    r   formr%      s     =flln=>>r   c            	           \ rS rSr% Sr\\   \S'   S\SS4S jrSS\	S\
\\4   4S	 jjrSS\	S\
\\4   4S
 jjrS\4S\	S\S\
\\4   4S jjrS\4S\	S\S\
\\4   4S jjrSrg)r   #   zMulti question prompts. Questions are asked one after another.

All the answers are returned as a dict with one entry per question.

This class should not be invoked directly, instead use :func:`form`.
form_fieldsr   Nc                     Xl         g r   r(   )selfr(   s     r   __init__Form.__init__-   s    &r   Fpatch_stdoutc                     U R                    Vs0 s H(  o"R                  UR                  R                  U5      _M*     sn$ s  snf )a  Ask the questions synchronously and return user response.

Does not catch keyboard interrupts.

Args:
    patch_stdout: Ensure that the prompt renders correctly if other threads
                  are printing to stdout.

Returns:
    The answers from the form.
)r(   r   r   
unsafe_askr+   r.   fs      r   r0   Form.unsafe_ask0   s<     EIDTDTUDTqqzz,,\::DTUUUs   /Ac                    #    U R                    Vs0 s H1  nUR                  UR                  R                  U5      I Sh  vN _M3     sn$  Ns  snf 7f)a  Ask the questions using asyncio and return user response.

Does not catch keyboard interrupts.

Args:
    patch_stdout: Ensure that the prompt renders correctly if other threads
                  are printing to stdout.

Returns:
    The answers from the form.
N)r(   r   r   unsafe_ask_asyncr1   s      r   r5   Form.unsafe_ask_async>   sP      %%
% EE44\BBB%
 	
B
s(   A/A AA	AAAkbi_msgc                 `     U R                  U5      $ ! [         a    [        U5        0 s $ f = f)a!  Ask the questions synchronously and return user response.

Args:
    patch_stdout: Ensure that the prompt renders correctly if other threads
                  are printing to stdout.

    kbi_msg: The message to be printed on a keyboard interrupt.

Returns:
    The answers from the form.
)r0   KeyboardInterruptprintr+   r.   r7   s      r   askForm.askO   s1    	??<00  	'NI	s    --c                 |   #     U R                  U5      I Sh  vN $  N! [         a    [        U5        0 s $ f = f7f)a!  Ask the questions using asyncio and return user response.

Args:
    patch_stdout: Ensure that the prompt renders correctly if other threads
                  are printing to stdout.

    kbi_msg: The message to be printed on a keyboard interrupt.

Returns:
    The answers from the form.
N)r5   r9   r:   r;   s      r   	ask_asyncForm.ask_asyncc   s;     	..|<<<<  	'NI	s(   <  < 9<9<r*   )F)r   r   r   r   r   r   r
   r   r,   boolr   r   r   r0   r5   r   r<   r?   r   r   r   r   r   r   #   s     )$$'Y '4 'Vt VS#X V
4 
DcN 
$ $)9L 36	c3h* $)9L 36	c3h r   N)typingr   r   r   r   questionary.constantsr   questionary.questionr   r
   r%   r   r   r   r   <module>rE      sB        5 )

 
	?8 	? 	?R Rr   