
     h                        d Z ddlmZ ddlmZmZmZ ddlmZ ddl	m
Z
mZmZmZ ddlmZ g dZ G d d	e
          Z G d de          Z G d de          Zedd            ZdS )z
Abstraction of CLI Input.
    )annotations)ABCMetaabstractmethodabstractproperty)contextmanager)CallableContextManager	GeneratorList)KeyPress)Input	PipeInput
DummyInputc                      e Zd ZdZedd            Zedd            Zedd            Zdd	ZddZ	e
dd            Zedd            Zedd            Zedd            Zedd            ZddZdS )r   z
    Abstraction for any input.

    An instance of this class can be given to the constructor of a
    :class:`~prompt_toolkit.application.Application` and will also be
    passed to the :class:`~prompt_toolkit.eventloop.base.EventLoop`.
    returnintc                    dS )z;
        Fileno for putting this in an event loop.
        N selfs    U/var/www/html/Sam_Eipo/venv/lib/python3.11/site-packages/prompt_toolkit/input/base.pyfilenozInput.fileno             strc                    dS )z@
        Identifier for storing type ahead key presses.
        Nr   r   s    r   typeahead_hashzInput.typeahead_hash"   r   r   list[KeyPress]c                    dS )zT
        Return a list of Key objects which are read/parsed from the input.
        Nr   r   s    r   	read_keyszInput.read_keys(   r   r   c                    g S )zk
        Flush the underlying parser. and return the pending keys.
        (Used for vt100 input.)
        r   r   s    r   
flush_keyszInput.flush_keys.   s	    
 	r   Nonec                    dS )z>The event loop can call this when the input has to be flushed.Nr   r   s    r   flushzInput.flush5       r   boolc                    dS )z/Should be true when the input stream is closed.Fr   r   s    r   closedzInput.closed9   s	     ur   ContextManager[None]c                    dS )zE
        Context manager that turns the input into raw mode.
        Nr   r   s    r   raw_modezInput.raw_mode>   r   r   c                    dS )zH
        Context manager that turns the input into cooked mode.
        Nr   r   s    r   cooked_modezInput.cooked_modeD   r   r   input_ready_callbackCallable[[], None]c                    dS )zj
        Return a context manager that makes this input active in the current
        event loop.
        Nr   r   r/   s     r   attachzInput.attachJ   r   r   c                    dS )z{
        Return a context manager that makes sure that this input is not active
        in the current event loop.
        Nr   r   s    r   detachzInput.detachQ   r   r   c                    dS )zClose input.Nr   r   s    r   closezInput.closeX   r&   r   Nr   r   r   r   r   r   )r   r#   r   r'   r   r*   r/   r0   r   r*   )__name__
__module____qualname____doc__r   r   r   r    r"   r%   r   r)   r,   r.   r3   r5   r7   r   r   r   r   r      s[            ^
    ^
    ^
              ^
    ^
    ^    ^     r   r   )	metaclassc                  B    e Zd ZdZed
d            Zedd            Zd	S )r   z%
    Abstraction for pipe input.
    databytesr   r#   c                    dS )zFeed byte string into the pipeNr   r   rD   s     r   
send_byteszPipeInput.send_bytesb   r   r   r   c                    dS )z Feed a text string into the pipeNr   rG   s     r   	send_textzPipeInput.send_textf   r   r   N)rD   rE   r   r#   )rD   r   r   r#   )r>   r?   r@   rA   r   rH   rJ   r   r   r   r   r   ]   s^          - - - ^- / / / ^/ / /r   r   c                  b    e Zd ZdZddZddZddZedd
            ZddZ	ddZ
ddZddZdS )r   z
    Input for use in a `DummyApplication`

    If used in an actual application, it will make the application render
    itself once and exit immediately, due to an `EOFError`.
    r   r   c                    t           N)NotImplementedErrorr   s    r   r   zDummyInput.filenos   s    !!r   r   c                &    dt          |           z  S )Nzdummy-%s)idr   s    r   r   zDummyInput.typeahead_hashv   s    BtHH$$r   r   c                    g S rM   r   r   s    r   r    zDummyInput.read_keysy   s    	r   r'   c                    dS )NTr   r   s    r   r)   zDummyInput.closed|   s	     tr   r*   c                    t                      S rM   _dummy_context_managerr   s    r   r,   zDummyInput.raw_mode       %'''r   c                    t                      S rM   rT   r   s    r   r.   zDummyInput.cooked_mode   rV   r   r/   r0   c                2     |             t                      S rM   rT   r2   s     r   r3   zDummyInput.attach   s     	%'''r   c                    t                      S rM   rT   r   s    r   r5   zDummyInput.detach   rV   r   Nr8   r9   r:   r;   r<   r=   )r>   r?   r@   rA   r   r   r    propertyr)   r,   r.   r3   r5   r   r   r   r   r   k   s         " " " "% % % %       X
( ( ( (( ( ( (( ( ( (( ( ( ( ( (r   r   r   Generator[None, None, None]c               #     K   d V  d S rM   r   r   r   r   rU   rU      s      	EEEEEr   N)r   r[   )rA   
__future__r   abcr   r   r   
contextlibr   typingr   r	   r
   r   prompt_toolkit.key_bindingr   __all__r   r   r   rU   r   r   r   <module>rc      sR    # " " " " " 9 9 9 9 9 9 9 9 9 9 % % % % % % < < < < < < < < < < < < / / / / / /  G G G G Gg G G G GT/ / / / / / / /(( (( (( (( (( (( (( ((V 
 
 
 
 
 
r   