B
    p®[   ã               @   st   d Z ddlZddlmZ ddlmZmZmZmZm	Z	 ddl
T ddlmZmZ dd	„ Zdd
d„ZeZdd„ Zeƒ  dS )a
  Interactive widgets for the Jupyter notebook.

Provide simple interactive controls in the notebook.
Each Widget corresponds to an object in Python and Javascript,
with controls on the page.

To put a Widget on the page, you can display it with IPython's display machinery::

    from ipywidgets import IntSlider
    from IPython.display import display
    slider = IntSlider(min=1, max=10)
    display(slider)

Moving the slider will change the value. Most Widgets have a current value,
accessible as a `value` attribute.
é    N)Úget_ipythoné   )Úversion_infoÚ__version__Ú__protocol_version__Ú$__jupyter_widgets_controls_version__Ú __jupyter_widgets_base_version__)Ú*)ÚlinkÚdlinkc             C   s   t | dƒsdS t| jƒ dS )z#Set up IPython to work with widgetsÚkernelN)ÚhasattrÚregister_comm_targetr   )Úip© r   ú2lib/python3.7/site-packages/ipywidgets/__init__.pyÚload_ipython_extension   s    
r   c             C   s$   | dkrt ƒ j} | j dtj¡ dS )z'Register the jupyter.widget comm targetNzjupyter.widget)r   r   Zcomm_managerZregister_targetZWidgetZhandle_comm_opened)r   r   r   r   r   $   s    r   c              C   s   t ƒ } | dkrdS t| ƒ dS )z=Register with the comm target at import if running in IPythonN)r   r   )r   r   r   r   Ú_handle_ipython-   s    r   )N)Ú__doc__ÚosZIPythonr   Z_versionr   r   r   r   r   ZwidgetsZ	traitletsr
   r   r   r   Zhandle_kernelr   r   r   r   r   Ú<module>   s   
