a
    lc                     @   s   d 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 ded	ZG d
d deZG dd deZee
d dddZdS )z
Abstraction of CLI Input.
    )ABCMetaabstractmethodabstractproperty)contextmanager)CallableContextManager	GeneratorList)KeyPress)Input	PipeInput
DummyInputc                   @   s   e Zd ZdZeedddZeedddZee	e
 dddZe	e
 dd	d
ZddddZeedddZeed dddZeed dddZeeg df ed dddZeed dddZdd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`.
    returnc                 C   s   dS )z;
        Fileno for putting this in an event loop.
        N selfr   r   U/var/www/html/django/DPS/env/lib/python3.9/site-packages/prompt_toolkit/input/base.pyfileno   s    zInput.filenoc                 C   s   dS )z@
        Identifier for storing type ahead key presses.
        Nr   r   r   r   r   typeahead_hash    s    zInput.typeahead_hashc                 C   s   dS )zT
        Return a list of Key objects which are read/parsed from the input.
        Nr   r   r   r   r   	read_keys&   s    zInput.read_keysc                 C   s   g S )zk
        Flush the underlying parser. and return the pending keys.
        (Used for vt100 input.)
        r   r   r   r   r   
flush_keys,   s    zInput.flush_keysNc                 C   s   dS )z>The event loop can call this when the input has to be flushed.Nr   r   r   r   r   flush3   s    zInput.flushc                 C   s   dS )z/Should be true when the input stream is closed.Fr   r   r   r   r   closed7   s    zInput.closedc                 C   s   dS )zE
        Context manager that turns the input into raw mode.
        Nr   r   r   r   r   raw_mode<   s    zInput.raw_modec                 C   s   dS )zH
        Context manager that turns the input into cooked mode.
        Nr   r   r   r   r   cooked_modeB   s    zInput.cooked_modeinput_ready_callbackr   c                 C   s   dS )zj
        Return a context manager that makes this input active in the current
        event loop.
        Nr   r   r   r   r   r   attachH   s    zInput.attachc                 C   s   dS )z{
        Return a context manager that makes sure that this input is not active
        in the current event loop.
        Nr   r   r   r   r   detachO   s    zInput.detachc                 C   s   dS )zClose input.Nr   r   r   r   r   closeV   s    zInput.close)__name__
__module____qualname____doc__r   intr   strr   r	   r
   r   r   r   r   boolr   r   r   r   r   r   r    r!   r   r   r   r   r      s(   r   )	metaclassc                   @   s8   e Zd ZdZeeddddZeeddddZdS )r   z%
    Abstraction for pipe input.
    N)datar   c                 C   s   dS )zFeed byte string into the pipeNr   r   r*   r   r   r   
send_bytes`   s    zPipeInput.send_bytesc                 C   s   dS )z Feed a text string into the pipeNr   r+   r   r   r   	send_textd   s    zPipeInput.send_text)	r"   r#   r$   r%   r   bytesr,   r'   r-   r   r   r   r   r   [   s
   r   c                   @   s   e Zd ZdZedddZedddZee	 dddZ
eedd	d
Zed dddZed dddZeg df ed dddZed d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   c                 C   s   t d S N)NotImplementedErrorr   r   r   r   r   q   s    zDummyInput.filenoc                 C   s   dt |  S )Nzdummy-%s)idr   r   r   r   r   t   s    zDummyInput.typeahead_hashc                 C   s   g S r/   r   r   r   r   r   r   w   s    zDummyInput.read_keysc                 C   s   dS )NTr   r   r   r   r   r   z   s    zDummyInput.closedNc                 C   s   t  S r/   _dummy_context_managerr   r   r   r   r      s    zDummyInput.raw_modec                 C   s   t  S r/   r2   r   r   r   r   r      s    zDummyInput.cooked_moder   c                 C   s   |  t  S r/   r2   r   r   r   r   r      s    zDummyInput.attachc                 C   s   t  S r/   r2   r   r   r   r   r       s    zDummyInput.detach)r"   r#   r$   r%   r&   r   r'   r   r	   r
   r   propertyr(   r   r   r   r   r   r   r    r   r   r   r   r   i   s   
r   )NNNr   c                   c   s
   d V  d S r/   r   r   r   r   r   r3      s    r3   N)r%   abcr   r   r   
contextlibr   typingr   r   r   r	   Zprompt_toolkit.key_bindingr
   __all__r   r   r   r3   r   r   r   r   <module>   s   J+