
    
                     X    d dl mZ d dlmZmZ d dlmZ dZdZ G d d eee	            Z
y)	    )unicode_literals)ABCMetaabstractmethod)with_metaclass)	EventLoopINPUT_TIMEOUTg      ?c                   ~    e Zd ZdZd Zd Zed        Zed        Zed        Z	ed        Z
ed        Zedd
       Zy	)r   z
    Eventloop interface.
    c                     t        d      )a/  
        Run the eventloop until stop() is called. Report all
        input/timeout/terminal-resize events to the callbacks.

        :param stdin: :class:`~prompt_toolkit.input.Input` instance.
        :param callbacks: :class:`~prompt_toolkit.eventloop.callbacks.EventLoopCallbacks` instance.
        z5This eventloop doesn't implement synchronous 'run()'.NotImplementedErrorselfstdin	callbackss      0lib/third_party/prompt_toolkit/eventloop/base.pyrunzEventLoop.run   s     ""YZZ    c                     t        d      )zW
        Similar to `run`, but this is a coroutine. (For asyncio integration.)
        z6This eventloop doesn't implement 'run_as_coroutine()'.r   r   s      r   run_as_coroutinezEventLoop.run_as_coroutine   s     ""Z[[r   c                      y)z
        Stop the `run` call. (Normally called by
        :class:`~prompt_toolkit.interface.CommandLineInterface`, when a result
        is available, or Abort/Quit has been called.)
        N r   s    r   stopzEventLoop.stop#       r   c                      y)zj
        Clean up of resources. Eventloop cannot be reused a second time after
        this call.
        Nr   r   s    r   closezEventLoop.close+   r   r   c                      y)zn
        Start watching the file descriptor for read availability and then call
        the callback.
        Nr   )r   fdcallbacks      r   
add_readerzEventLoop.add_reader2   r   r   c                      y)zJ
        Stop watching the file descriptor for read availability.
        Nr   )r   r   s     r   remove_readerzEventLoop.remove_reader9   r   r   c                      y)z
        Run a long running function in a background thread. (This is
        recommended for code that could block the event loop.)
        Similar to Twisted's ``deferToThread``.
        Nr   )r   r   s     r   run_in_executorzEventLoop.run_in_executor?   r   r   Nc                      y)aq  
        Call this function in the main event loop. Similar to Twisted's
        ``callFromThread``.

        :param _max_postpone_until: `None` or `time.time` value. For interal
            use. If the eventloop is saturated, consider this task to be low
            priority and postpone maximum until this timestamp. (For instance,
            repaint is done using low priority.)

            Note: In the past, this used to be a datetime.datetime instance,
                  but apparently, executing `time.time` is more efficient: it
                  does fewer system calls. (It doesn't read /etc/localtime.)
        Nr   )r   r   _max_postpone_untils      r   call_from_executorzEventLoop.call_from_executorG   r   r   )N)__name__
__module____qualname____doc__r   r   r   r   r   r    r"   r$   r'   r   r   r   r   r      s    [\        
    r   r   N)
__future__r   abcr   r   sixr   __all__r   objectr   r   r   r   <module>r1      s1    ' '  Fw/ Fr   