ó
±xYc           @  s6   d  Z  d d l m Z d Z d e f d „  ƒ  YZ d S(   uÖ   
Eventloop for integration with Python3 asyncio.

Note that we can't use "yield from", because the package should be installable
under Python 2.6 as well, and it should contain syntactically valid Python 2.6
code.
iÿÿÿÿ(   t   unicode_literalsu   AsyncioTimeoutt   AsyncioTimeoutc           B  s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   u”   
    Call the `timeout` function when the timeout expires.
    Every call of the `reset` method, resets the timeout and starts a new
    timer.
    c         C  s1   | |  _  | |  _ | |  _ d |  _ t |  _ d  S(   Ni    (   t   timeoutt   callbackt   loopt   countert   Truet   running(   t   selfR   R   R   (    (    sD   lib/python2.7/site-packages/prompt_toolkit/eventloop/asyncio_base.pyt   __init__   s
    				c           sD   ˆ j  d 7_  ˆ j  ‰  ‡  ‡ f d †  } ˆ j j ˆ j | ƒ d S(   u8   
        Reset the timeout. Starts a new timer.
        i   c             s)   ˆ j  ˆ  k r% ˆ j r% ˆ j ƒ  n  d  S(   N(   R   R   R   (    (   t   local_counterR   (    sD   lib/python2.7/site-packages/prompt_toolkit/eventloop/asyncio_base.pyt   timer_timeout$   s    N(   R   R   t
   call_laterR   (   R   R   (    (   R
   R   sD   lib/python2.7/site-packages/prompt_toolkit/eventloop/asyncio_base.pyt   reset   s    	c         C  s   t  |  _ d S(   uB   
        Ignore timeout. Don't call the callback anymore.
        N(   t   FalseR   (   R   (    (    sD   lib/python2.7/site-packages/prompt_toolkit/eventloop/asyncio_base.pyt   stop*   s    (   t   __name__t
   __module__t   __doc__R	   R   R   (    (    (    sD   lib/python2.7/site-packages/prompt_toolkit/eventloop/asyncio_base.pyR      s   		N(   u   AsyncioTimeout(   R   t
   __future__R    t   __all__t   objectR   (    (    (    sD   lib/python2.7/site-packages/prompt_toolkit/eventloop/asyncio_base.pyt   <module>   s   