ó
&9_[c           @@  sH   d  Z  d d l m Z d d l Z d d l Z e j j   d   Z d S(   s   
PyGTK input hook for prompt_toolkit.

Listens on the pipe prompt_toolkit sets up for a notification that it should
return control to the terminal event loop.
i    (   t   absolute_importNc         C@  s3   d   } t  j |  j   t  j |  t j   d S(   sæ   
    When the eventloop of prompt-toolkit is idle, call this inputhook.

    This will run the GTK main loop until the file descriptor
    `context.fileno()` becomes ready.

    :param context: An `InputHookContext` instance.
    c          _@  s   t  j   t S(   N(   t   gtkt	   main_quitt   False(   t   at   kw(    (    sA   lib/python2.7/site-packages/IPython/terminal/pt_inputhooks/gtk.pyt
   _main_quit6   s    
N(   t   gobjectt   io_add_watcht   filenot   IO_INR   t   main(   t   contextR   (    (    sA   lib/python2.7/site-packages/IPython/terminal/pt_inputhooks/gtk.pyt	   inputhook-   s    		(   t   __doc__t
   __future__R    R   R   t   gdkt   threads_initR   (    (    (    sA   lib/python2.7/site-packages/IPython/terminal/pt_inputhooks/gtk.pyt   <module>%   s   