ó
_y]c           @   s  d  Z  d d l m Z d d l m Z m Z m Z d d l m Z d d l	 m
 Z
 d d l m Z d d l m Z m Z d d	 l m Z d
 e e f d „  ƒ  YZ d e e f d „  ƒ  YZ d e e f d „  ƒ  YZ d e e f d „  ƒ  YZ d e f d „  ƒ  YZ d S(   s=    Defines an in-process KernelManager with signals and slots.
iÿÿÿÿ(   t   QtCore(   t   InProcessHBChannelt   InProcessKernelClientt   InProcessKernelManager(   t   InProcessChannel(   t   Typei   (   t   SuperQObject(   t   QtKernelClientMixint   QtKernelManagerMixin(   t   RichJupyterWidgett   QtInProcessChannelc           B   sh   e  Z e j ƒ  Z e j ƒ  Z e j e ƒ Z d  „  Z d „  Z	 d „  Z
 d „  Z d „  Z d d „ Z RS(   c         C   s$   t  t |  ƒ j ƒ  |  j j ƒ  d S(   s'    Reimplemented to emit signal.
        N(   t   superR
   t   startt   startedt   emit(   t   self(    (    s2   lib/python2.7/site-packages/qtconsole/inprocess.pyR      s    c         C   s$   t  t |  ƒ j ƒ  |  j j ƒ  d S(   s'    Reimplemented to emit signal.
        N(   R   R
   t   stopt   stoppedR   (   R   (    (    s2   lib/python2.7/site-packages/qtconsole/inprocess.pyR   !   s    c            s,   ‡  ‡ ‡ f d †  } t  j j d | ƒ d S(   s*    Call the message handlers later.
        c              s   ˆ j  ˆ  ˆ Ž  S(   N(   t   call_handlers(    (   t   argst   kwdsR   (    s2   lib/python2.7/site-packages/qtconsole/inprocess.pyt   <lambda>*   t    i    N(   R    t   QTimert
   singleShot(   R   R   R   t   do_later(    (   R   R   R   s2   lib/python2.7/site-packages/qtconsole/inprocess.pyt   call_handlers_later'   s    c         C   s   |  j  j | ƒ d  S(   N(   t   message_receivedR   (   R   t   msg(    (    s2   lib/python2.7/site-packages/qtconsole/inprocess.pyR   -   s    c         C   s   t  j j ƒ  j ƒ  d S(   s)    Process any pending GUI events.
        N(   R    t   QCoreApplicationt   instancet   processEvents(   R   (    (    s2   lib/python2.7/site-packages/qtconsole/inprocess.pyt   process_events0   s    g      ð?c         C   s!   t  t |  ƒ j ƒ  |  j ƒ  d S(   sJ    Reimplemented to ensure that signals are dispatched immediately.
        N(   R   R
   t   flushR    (   R   t   timeout(    (    s2   lib/python2.7/site-packages/qtconsole/inprocess.pyR!   5   s    (   t   __name__t
   __module__R    t   SignalR   R   t   objectR   R   R   R   R   R    R!   (    (    (    s2   lib/python2.7/site-packages/qtconsole/inprocess.pyR
      s   					t   QtInProcessHBChannelc           B   s   e  Z e j ƒ  Z RS(    (   R#   R$   R    R%   t   kernel_died(    (    (    s2   lib/python2.7/site-packages/qtconsole/inprocess.pyR'   <   s   t   QtInProcessKernelClientc           B   s>   e  Z d  Z e e ƒ Z e e ƒ Z e e ƒ Z e e ƒ Z	 RS(   s9    An in-process KernelManager with signals and slots.
    (
   R#   R$   t   __doc__R   R
   t   iopub_channel_classt   shell_channel_classt   stdin_channel_classR'   t   hb_channel_class(    (    (    s2   lib/python2.7/site-packages/qtconsole/inprocess.pyR)   A   s
   t   QtInProcessKernelManagerc           B   s   e  Z e d  Z RS(   s   .QtInProcessKernelClient(   R#   R$   t   client_class(    (    (    s2   lib/python2.7/site-packages/qtconsole/inprocess.pyR/   J   s   t   QtInProcessRichJupyterWidgetc           B   s   e  Z d  Z e d „ Z RS(   sA    An in-process Jupyter Widget that enables multiline editing
    c         C   sV   |  j  j j } | j j | ƒ \ } } | d  k r< d } n
 d | } | d k | f S(   NR   t    t
   incomplete(   t   kernel_managert   kernelt   shellt   input_transformer_managert   check_completet   None(   R   t   sourcet   interactiveR6   t   statust   indent_spacest   indent(    (    s2   lib/python2.7/site-packages/qtconsole/inprocess.pyt   _is_completeR   s    	
(   R#   R$   R*   t   TrueR?   (    (    (    s2   lib/python2.7/site-packages/qtconsole/inprocess.pyR1   N   s   N(   R*   t   qtconsole.qtR    t   ipykernel.inprocessR   R   R   t   ipykernel.inprocess.channelsR   t	   traitletsR   t   utilR   t   kernel_mixinsR   R   t   rich_jupyter_widgetR	   R
   R'   R)   R/   R1   (    (    (    s2   lib/python2.7/site-packages/qtconsole/inprocess.pyt   <module>   s   +	