
    ^h                        S r SSKJr  SSKJrJr  SSKJr  SSKJ	r	J
r
Jr  SSKJr  / SQr " S S	\S
9r " S S\5      r " S S\5      r\SS j5       rg)z
Abstraction of CLI Input.
    )annotations)ABCMetaabstractmethod)contextmanager)CallableContextManager	Generator)KeyPress)Input	PipeInput
DummyInputc                      \ rS rSrSr\SS j5       r\SS j5       r\SS j5       rSS jr	SS jr
\\SS j5       5       r\SS	 j5       r\SS
 j5       r\SS j5       r\SS j5       rSS jrSrg)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`.
c                    g)z+
Fileno for putting this in an event loop.
N selfs    S/home/james-whalen/.local/lib/python3.13/site-packages/prompt_toolkit/input/base.pyfilenoInput.fileno           c                    g)z0
Identifier for storing type ahead key presses.
Nr   r   s    r   typeahead_hashInput.typeahead_hash#   r   r   c                    g)zD
Return a list of Key objects which are read/parsed from the input.
Nr   r   s    r   	read_keysInput.read_keys)   r   r   c                    / $ )zS
Flush the underlying parser. and return the pending keys.
(Used for vt100 input.)
r   r   s    r   
flush_keysInput.flush_keys/   s	    
 	r   c                    g)z>The event loop can call this when the input has to be flushed.Nr   r   s    r   flushInput.flush6       r   c                    g)z/Should be true when the input stream is closed.Fr   r   s    r   closedInput.closed:   s     r   c                    g)z5
Context manager that turns the input into raw mode.
Nr   r   s    r   raw_modeInput.raw_mode@   r   r   c                    g)z8
Context manager that turns the input into cooked mode.
Nr   r   s    r   cooked_modeInput.cooked_modeF   r   r   c                    g)zR
Return a context manager that makes this input active in the current
event loop.
Nr   r   input_ready_callbacks     r   attachInput.attachL   r   r   c                    g)zc
Return a context manager that makes sure that this input is not active
in the current event loop.
Nr   r   s    r   detachInput.detachS   r   r   c                    g)zClose input.Nr   r   s    r   closeInput.closeZ   r%   r   r   Nreturnintr;   strr;   zlist[KeyPress])r;   Noner;   boolr;   ContextManager[None]r1   zCallable[[], None]r;   rD   )__name__
__module____qualname____firstlineno____doc__r   r   r   r   r    r#   propertyr'   r*   r-   r2   r5   r8   __static_attributes__r   r   r   r   r      s      
  
  
     
  
    r   r   )	metaclassc                  @    \ rS rSrSr\SS j5       r\SS j5       rSrg)	r   _   z
Abstraction for pipe input.
c                    g)zFeed byte string into the pipeNr   r   datas     r   
send_bytesPipeInput.send_bytesd   r   r   c                    g)z Feed a text string into the pipeNr   rQ   s     r   	send_textPipeInput.send_texth   r   r   r   N)rR   bytesr;   r@   )rR   r>   r;   r@   )	rF   rG   rH   rI   rJ   r   rS   rV   rL   r   r   r   r   r   _   s/     - - / /r   r   c                  r    \ rS rSrSrSS jrSS jrSS jr\SS j5       r	SS jr
SS jrSS	 jrSS
 jrSrg)r   m   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`.
c                    [         eN)NotImplementedErrorr   s    r   r   DummyInput.filenou   s    !!r   c                    S[        U 5       3$ )Nzdummy-)idr   s    r   r   DummyInput.typeahead_hashx   s    4z""r   c                    / $ r\   r   r   s    r   r   DummyInput.read_keys{   s    	r   c                    g)NTr   r   s    r   r'   DummyInput.closed~   s     r   c                    [        5       $ r\   _dummy_context_managerr   s    r   r*   DummyInput.raw_mode       %''r   c                    [        5       $ r\   rg   r   s    r   r-   DummyInput.cooked_mode   rj   r   c                $    U" 5         [        5       $ r\   rg   r0   s     r   r2   DummyInput.attach   s     	%''r   c                    [        5       $ r\   rg   r   s    r   r5   DummyInput.detach   rj   r   r   Nr:   r=   r?   rA   rC   rE   )rF   rG   rH   rI   rJ   r   r   r   rK   r'   r*   r-   r2   r5   rL   r   r   r   r   r   m   s>    "#  
((((r   r   c               #     #    S v   g 7fr\   r   r   r   r   rh   rh      s     	s   N)r;   zGenerator[None, None, None])rJ   
__future__r   abcr   r   
contextlibr   typingr   r   r	   prompt_toolkit.key_bindingr
   __all__r   r   r   rh   r   r   r   <module>rx      sa    # ' % 6 6 /Hg HV/ /(( ((V 
 
r   