ó
±xYc           @  se   d  d l  m Z d  d l m Z m Z d  d l m Z d
 Z d Z d e e e	 ƒ f d „  ƒ  YZ
 d	 S(   iÿÿÿÿ(   t   unicode_literals(   t   ABCMetat   abstractmethod(   t   with_metaclassu	   EventLoopu   INPUT_TIMEOUTg      à?t	   EventLoopc           B  s}   e  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 RS(
   u   
    Eventloop interface.
    c         C  s   t  d ƒ ‚ d S(   u/  
        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.
        u5   This eventloop doesn't implement synchronous 'run()'.N(   t   NotImplementedError(   t   selft   stdint	   callbacks(    (    s<   lib/python2.7/site-packages/prompt_toolkit/eventloop/base.pyt   run   s    c         C  s   t  d ƒ ‚ d S(   uW   
        Similar to `run`, but this is a coroutine. (For asyncio integration.)
        u6   This eventloop doesn't implement 'run_as_coroutine()'.N(   R   (   R   R   R   (    (    s<   lib/python2.7/site-packages/prompt_toolkit/eventloop/base.pyt   run_as_coroutine   s    c         C  s   d S(   u¿   
        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<   lib/python2.7/site-packages/prompt_toolkit/eventloop/base.pyt   stop#   s    c         C  s   d S(   uj   
        Clean up of resources. Eventloop cannot be reused a second time after
        this call.
        N(    (   R   (    (    s<   lib/python2.7/site-packages/prompt_toolkit/eventloop/base.pyt   close+   s    c         C  s   d S(   un   
        Start watching the file descriptor for read availability and then call
        the callback.
        N(    (   R   t   fdt   callback(    (    s<   lib/python2.7/site-packages/prompt_toolkit/eventloop/base.pyt
   add_reader2   s    c         C  s   d S(   uJ   
        Stop watching the file descriptor for read availability.
        N(    (   R   R   (    (    s<   lib/python2.7/site-packages/prompt_toolkit/eventloop/base.pyt   remove_reader9   s    c         C  s   d S(   u½   
        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``.
        N(    (   R   R   (    (    s<   lib/python2.7/site-packages/prompt_toolkit/eventloop/base.pyt   run_in_executor?   s    c         C  s   d S(   uq  
        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.)
        N(    (   R   R   t   _max_postpone_until(    (    s<   lib/python2.7/site-packages/prompt_toolkit/eventloop/base.pyt   call_from_executorG   s    N(   t   __name__t
   __module__t   __doc__R	   R
   R   R   R   R   R   R   t   NoneR   (    (    (    s<   lib/python2.7/site-packages/prompt_toolkit/eventloop/base.pyR      s   	
	N(   u	   EventLoopu   INPUT_TIMEOUT(   t
   __future__R    t   abcR   R   t   sixR   t   __all__t   INPUT_TIMEOUTt   objectR   (    (    (    s<   lib/python2.7/site-packages/prompt_toolkit/eventloop/base.pyt   <module>   s    