ó
c?[c           @   sx   d  Z  y d d l m Z Wn! e k
 r= d d l m Z n Xd d l m Z d d l m Z d e f d     YZ	 d S(   s7   Adapt readline completer interface to make ZMQ request.i˙˙˙˙(   t   Empty(   t   Configurable(   t   Floatt   ZMQCompleterc           B   s;   e  Z d  Z e d d e d d Z d d  Z d   Z RS(   sç   Client-side completion machinery.

    How it works: self.complete will be called multiple times, with
    state=0,1,2,... When state=0 it should compute ALL the completion matches,
    and then return them for each value of state.g      @t   configt   helps   timeout before completion abortc         C   s8   t  t |   j d |  | |  _ | |  _ g  |  _ d  S(   NR   (   t   superR   t   __init__t   shellt   clientt   matches(   t   selfR   R	   R   (    (    s8   lib/python2.7/site-packages/jupyter_console/completer.pyR      s    		c         C   sy   |  j  j d | d |  } |  j  j j d |  j  } | d d | k rR | d Si g  d 6d d	 6d d
 6i  d 6d d 6S(   Nt   codet
   cursor_post   timeoutt   parent_headert   msg_idt   contentR
   i    t   cursor_startt
   cursor_endt   metadatat   okt   status(   R	   t   completet   shell_channelt   get_msgR   (   R   R   R   R   t   msg(    (    s8   lib/python2.7/site-packages/jupyter_console/completer.pyt   complete_request   s    	N(	   t   __name__t
   __module__t   __doc__R   t   TrueR   t   NoneR   R   (    (    (    s8   lib/python2.7/site-packages/jupyter_console/completer.pyR      s   N(
   R   t   queueR    t   ImportErrort   Queuet   traitlets.configR   t	   traitletsR   R   (    (    (    s8   lib/python2.7/site-packages/jupyter_console/completer.pyt   <module>   s   