
    
                     X    S SK Jr  S SKJrJr  S SKJr  SrSr " S S\" \\	5      5      r
g)	    )unicode_literals)ABCMetaabstractmethod)with_metaclass)	EventLoopINPUT_TIMEOUTg      ?c                       \ rS rSrSrS rS r\S 5       r\S 5       r	\S 5       r
\S 5       r\S	 5       r\SS j5       rSrg
)r      z
Eventloop interface.
c                     [        S5      e)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runEventLoop.run   s     ""YZZ    c                     [        S5      e)zG
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_coroutineEventLoop.run_as_coroutine   s     ""Z[[r   c                     g)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   stopEventLoop.stop#       r   c                     g)zR
Clean up of resources. Eventloop cannot be reused a second time after
this call.
Nr   r   s    r   closeEventLoop.close+   r   r   c                     g)zV
Start watching the file descriptor for read availability and then call
the callback.
Nr   )r   fdcallbacks      r   
add_readerEventLoop.add_reader2   r   r   c                     g)z:
Stop watching the file descriptor for read availability.
Nr   )r   r#   s     r   remove_readerEventLoop.remove_reader9   r   r   c                     g)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_executorEventLoop.run_in_executor?   r   r   Nc                     g)a!  
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_executorEventLoop.call_from_executorG   r   r   r   )N)__name__
__module____qualname____firstlineno____doc__r   r   r   r   r    r%   r(   r+   r/   __static_attributes__r   r   r   r   r      s    [\        
    r   r   N)
__future__r   abcr   r   sixr   __all__r   objectr   r   r   r   <module>r<      s1    ' '  Fw/ Fr   