ó
Ýà‹]c           @@  sl   d  Z  d d l m Z d d l Z d d l m Z d d l m Z d d l m	 Z	 d e f d „  ƒ  YZ
 d S(	   sœ   A basic in process kernel monitor with autorestarting.

This watches a kernel's state using KernelManager.is_alive and auto
restarts the kernel if it dies.
i    (   t   absolute_importN(   t   ioloop(   t   KernelRestarter(   t   Instancet   IOLoopKernelRestarterc           B@  s;   e  Z d  Z e d ƒ Z d „  Z d Z d „  Z d „  Z	 RS(   s!   Monitor and autorestart a kernel.s   tornado.ioloop.IOLoopc         C@  s#   t  j d t d d ƒt j j ƒ  S(   Ns>   IOLoopKernelRestarter.loop is deprecated in jupyter-client 5.2t
   stackleveli   (   t   warningst   warnt   DeprecationWarningR   t   IOLoopt   current(   t   self(    (    s>   lib/python2.7/site-packages/jupyter_client/ioloop/restarter.pyt   _loop_default   s    	c         C@  sB   |  j  d k r> t j |  j d |  j ƒ |  _  |  j  j ƒ  n  d S(   s    Start the polling of the kernel.iè  N(   t
   _pcallbackt   NoneR   t   PeriodicCallbackt   pollt   time_to_deadt   start(   R   (    (    s>   lib/python2.7/site-packages/jupyter_client/ioloop/restarter.pyR       s    c         C@  s,   |  j  d k	 r( |  j  j ƒ  d |  _  n  d S(   s   Stop the kernel polling.N(   R   R   t   stop(   R   (    (    s>   lib/python2.7/site-packages/jupyter_client/ioloop/restarter.pyR   (   s    N(
   t   __name__t
   __module__t   __doc__R   t   loopR   R   R   R   R   (    (    (    s>   lib/python2.7/site-packages/jupyter_client/ioloop/restarter.pyR      s   		(   R   t
   __future__R    R   t   zmq.eventloopR   t   jupyter_client.restarterR   t	   traitletsR   R   (    (    (    s>   lib/python2.7/site-packages/jupyter_client/ioloop/restarter.pyt   <module>   s   