ó
/¾I]c           @   sA  d  Z  y d d l m Z m Z Wn' e k
 rI d d l m Z m Z n Xy d d l m Z Wn e k
 rw e Z n Xd d l m	 Z	 d d l
 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 m Z d d l m Z d d l m Z m Z m Z m Z m  Z  m! Z! m" Z" m# Z# m$ Z$ m% Z% m& Z& d d l' m( Z( i  Z) d e) d <d e) d <d e) d <d „  Z* d „  d „ Z+ d e e e f d „  ƒ  YZ, d e e e f d „  ƒ  YZ- e d e e f d „  ƒ  Yƒ Z. e e e) ƒ d e, f d „  ƒ  Yƒ ƒ Z/ e e e) ƒ d  e, f d! „  ƒ  Yƒ ƒ Z0 e e e) ƒ d" e, f d# „  ƒ  Yƒ ƒ Z1 e e e) ƒ d$ e, f d% „  ƒ  Yƒ ƒ Z2 e e e) ƒ d& e- f d' „  ƒ  Yƒ ƒ Z3 d( e, f d) „  ƒ  YZ4 d* e- f d+ „  ƒ  YZ5 e e e) ƒ d, e4 f d- „  ƒ  Yƒ ƒ Z6 e e e) ƒ d. e5 f d/ „  ƒ  Yƒ ƒ Z7 d0 S(1   s>   Selection classes.

Represents an enumeration using a widget.
iÿÿÿÿ(   t   Iterablet   Mapping(   t   izip(   t   chaini   (   t   DescriptionWidgett   DescriptionStyle(   t   ValueWidget(   t
   CoreWidget(   t   Style(   t   InstanceDictt
   TypedTuple(   t   registert   widget_serialization(   t	   doc_subst(   t   Unicodet   Boolt   Intt   Anyt   Dictt
   TraitErrort   CaselessStrEnumt   Tuplet   Uniont   observet   validate(   t   unicode_typesô  
    options: list
        The options for the dropdown. This can either be a list of values, e.g.
        ``['Galileo', 'Brahe', 'Hubble']`` or ``[0, 1, 2]``, or a list of
        (label, value) pairs, e.g.
        ``[('Galileo', 0), ('Brahe', 1), ('Hubble', 2)]``.

    index: int
        The index of the current selection.

    value: any
        The value of the current selection. When programmatically setting the
        value, a reverse lookup is performed among the options to check that
        the value is valid. The reverse lookup uses the equality operator by
        default, but another predicate may be provided via the ``equals``
        keyword argument. For example, when dealing with numpy arrays, one may
        set ``equals=np.array_equal``.

    label: str
        The label corresponding to the selected value.

    disabled: bool
        Whether to disable user changes.

    description: str
        Label for this input group. This should be a string
        describing the widget.
t   selection_paramsst  
    options: dict or list
        The options for the dropdown. This can either be a list of values, e.g.
        ``['Galileo', 'Brahe', 'Hubble']`` or ``[0, 1, 2]``, a list of
        (label, value) pairs, e.g.
        ``[('Galileo', 0), ('Brahe', 1), ('Hubble', 2)]``,
        or a dictionary mapping the labels to the values, e.g. ``{'Galileo': 0,
        'Brahe': 1, 'Hubble': 2}``. The labels are the strings that will be
        displayed in the UI, representing the actual Python choices, and should
        be unique. If this is a dictionary, the order in which they are
        displayed is not guaranteed.

    index: iterable of int
        The indices of the options that are selected.

    value: iterable
        The values that are selected. When programmatically setting the
        value, a reverse lookup is performed among the options to check that
        the value is valid. The reverse lookup uses the equality operator by
        default, but another predicate may be provided via the ``equals``
        keyword argument. For example, when dealing with numpy arrays, one may
        set ``equals=np.array_equal``.

    label: iterable of str
        The labels corresponding to the selected value.

    disabled: bool
        Whether to disable user changes.

    description: str
        Label for this input group. This should be a string
        describing the widget.
t   multiple_selection_paramss³  
    orientation: str
        Either ``'horizontal'`` or ``'vertical'``. Defaults to ``horizontal``.

    readout: bool
        Display the current label next to the slider. Defaults to ``True``.

    continuous_update: bool
        If ``True``, update the value of the widget continuously as the user
        holds the slider. Otherwise, the model is only updated after the
        user has released the slider. Defaults to ``True``.
t   slider_paramsc         C   s   t  |  t ƒ rE d d l } | j d t ƒ t d „  |  j ƒ  Dƒ ƒ St |  ƒ } t d „  | Dƒ ƒ r{ t d „  | Dƒ ƒ St d „  | Dƒ ƒ S(   sÿ   Standardize the options tuple format.

    The returned tuple should be in the format (('label', value), ('label', value), ...).

    The input can be
    * an iterable of (label, value) pairs
    * an iterable of values, and labels will be generated
    iÿÿÿÿNsV   Support for mapping types has been deprecated and will be dropped in a future release.c         s   s'   |  ] \ } } t  | ƒ | f Vq d  S(   N(   R   (   t   .0t   kt   v(    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>z   s    c         s   s6   |  ], } t  | t t f ƒ o- t | ƒ d  k Vq d S(   i   N(   t
   isinstancet   listt   tuplet   len(   R   t   i(    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>€   s    c         s   s'   |  ] \ } } t  | ƒ | f Vq d  S(   N(   R   (   R   R   R   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>   s    c         s   s!   |  ] } t  | ƒ | f Vq d  S(   N(   R   (   R   R$   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>„   s    (   R    R   t   warningst   warnt   DeprecationWarningR"   t   itemst   all(   t   xR%   t   xlist(    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyt   _make_optionsm   s    
c         C   s
   |  | k S(   N(    (   R*   t   y(    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyt   <lambda>†   t    c            sI   y! t  ‡  ‡ f d †  |  Dƒ ƒ SWn! t k
 rD t d ˆ ƒ ‚ n Xd S(   sJ   A function that uses the compare function to return a value from the list.c         3   s$   |  ] } ˆ  | ˆ ƒ r | Vq d  S(   N(    (   R   R*   (   t   comparet   value(    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>‰   s    s   %r not in arrayN(   t   nextt   StopIterationt
   ValueError(   t   arrayR1   R0   (    (   R0   R1   sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyt	   findvalue†   s    !t
   _Selectionc           B   sy  e  Z d  Z e d d d d e ƒZ e d d d d e ƒZ e	 d d d d e ƒj
 d e ƒ Z e d d d ƒZ d Z e d e ƒ  d	 e d d
 ƒ j
 d e ƒ Z e d d ƒ j
 d e ƒ Z d „  Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z d „  Z RS(   sÅ  Base class for Selection widgets

    ``options`` can be specified as a list of values, list of (label, value)
    tuples, or a dict of {label: value}. The labels are the strings that will be
    displayed in the UI, representing the actual Python choices, and should be
    unique. If labels are not specified, they are generated from the values.

    When programmatically setting the value, a reverse lookup is performed
    among the options to check that the value is valid. The reverse lookup uses
    the equality operator by default, but another predicate may be provided via
    the ``equals`` keyword argument. For example, when dealing with numpy arrays,
    one may set equals=np.array_equal.
    t   helps   Selected valuet
   allow_nones   Selected labels   Selected indext   syncsñ   Iterable of values, (label, value) pairs, or a mapping of {label: value} pairs that the user can select.

    The labels are the strings that will be displayed in the UI, representing the
    actual Python choices, and should be unique.
    t   traitt	   read_onlys   The labels for the options.s   Enable or disable user changesc         O   s  | j  d d „  ƒ |  _ t |  _ t | j d d ƒ ƒ } | |  _ |  j d t d „  | Dƒ ƒ ƒ t d „  | Dƒ ƒ |  _	 d | k rî d | k rî d	 | k rî t
 | ƒ d
 k } | r½ d
 n d  | d <| r× | d
 n d \ | d	 <| d <n  t t |  ƒ j | | Ž  t |  _ d  S(   Nt   equalsc         S   s
   |  | k S(   N(    (   R*   R-   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyR.   ¯   R/   t   optionst   _options_labelsc         s   s   |  ] } | d  Vq d S(   i    N(    (   R   R$   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>µ   s    c         s   s   |  ] } | d  Vq d S(   i   N(    (   R   R$   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>¶   s    t   indexR1   t   labeli    (    (   NN(   t   popR=   t   Truet   _initializing_traits_R,   t   gett   _options_fullt	   set_traitR"   t   _options_valuesR#   t   Nonet   superR7   t   __init__t   False(   t   selft   argst   kwargsR>   t   nonempty(    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRK   ®   s    		 $'R>   c         C   sS   t  | j t ƒ r: t  | j t ƒ r: t | j ƒ | _ n  t | j ƒ |  _ | j S(   N(   R    R1   R    R   R"   R,   RF   (   RM   t   proposal(    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyt   _validate_optionsÁ   s    %c         C   s¤   |  j  } |  j d t d „  | Dƒ ƒ ƒ t d „  | Dƒ ƒ |  _ |  j t k	 r  t | ƒ d k r” |  j d k rˆ |  j d d d ƒ q d |  _ q  d |  _ n  d S(   sP   Set the values and labels, and select the first option if we aren't initializingR?   c         s   s   |  ] } | d  Vq d S(   i    N(    (   R   R$   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>Î   s    c         s   s   |  ] } | d  Vq d S(   i   N(    (   R   R$   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>Ï   s    i    R@   N(
   RF   RG   R"   RH   RD   RC   R#   R@   t   _notify_traitRI   (   RM   t   changeR>   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyt   _propagate_optionsÊ   s    	 R@   c         C   sN   | j  d  k s7 d | j  k o2 t |  j ƒ k  n r> | j  St d ƒ ‚ d  S(   Ni    s&   Invalid selection: index out of bounds(   R1   RI   R#   R?   R   (   RM   RQ   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyt   _validate_indexÜ   s    7c         C   s„   | j  d k	 r |  j | j  n d } | j  d k	 rD |  j | j  n d } |  j | k	 re | |  _ n  |  j | k	 r€ | |  _ n  d S(   s<   Propagate changes in index to the value and label propertiesN(   t   newRI   R?   RH   RA   R1   (   RM   RT   RA   R1   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyt   _propagate_indexã   s    %%R1   c         C   sW   | j  } y* | d  k	 r. t |  j | |  j ƒ Sd  SWn t k
 rR t d ƒ ‚ n Xd  S(   Ns"   Invalid selection: value not found(   R1   RI   R6   RH   R=   R4   R   (   RM   RQ   R1   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyt   _validate_valueí   s
    	*c         C   s€   | j  d  k r d  } nI |  j d  k	 rL |  j |  j | j  k rL |  j } n |  j j | j  ƒ } |  j | k r| | |  _ n  d  S(   N(   RW   RI   R@   RH   (   RM   RT   R@   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyt   _propagate_valueõ   s    	(RA   c         C   s7   | j  d  k	 r0 | j  |  j k r0 t d ƒ ‚ n  | j  S(   Ns"   Invalid selection: label not found(   R1   RI   R?   R   (   RM   RQ   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyt   _validate_label   s    !c         C   s€   | j  d  k r d  } nI |  j d  k	 rL |  j |  j | j  k rL |  j } n |  j j | j  ƒ } |  j | k r| | |  _ n  d  S(   N(   RW   RI   R@   R?   (   RM   RT   R@   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyt   _propagate_label  s    	(c         c   s_   t  t |  ƒ j ƒ  } xC t t | d ƒ ƒ D], } | d k rR |  j d k rR q+ n  | Vq+ Wd  S(   NR>   R@   i    (   R>   (   RJ   R7   t
   _repr_keyst   sortedR   R@   (   RM   t   keyst   key(    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyR]     s
    N(    (   t   __name__t
   __module__t   __doc__R   RI   RC   R1   R   RA   R   t   tagR@   R>   RF   R
   R?   R   t   disabledRK   R   RR   R   RU   RV   RX   RY   RZ   R[   R\   R]   (    (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyR7      s&   $		*		
t   _MultipleSelectionc           B   sy  e  Z d  Z e d e ƒ  d d ƒ Z e d e ƒ  d d ƒ Z e d e ƒ  d d ƒ j	 d e
 ƒ Z e d d d ƒZ d Z e d e ƒ  d e
 d d	 ƒ j	 d e
 ƒ Z e d d
 ƒ j	 d e
 ƒ Z d „  Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z d „  Z RS(   sÎ  Base class for multiple Selection widgets

    ``options`` can be specified as a list of values, list of (label, value)
    tuples, or a dict of {label: value}. The labels are the strings that will be
    displayed in the UI, representing the actual Python choices, and should be
    unique. If labels are not specified, they are generated from the values.

    When programmatically setting the value, a reverse lookup is performed
    among the options to check that the value is valid. The reverse lookup uses
    the equality operator by default, but another predicate may be provided via
    the ``equals`` keyword argument. For example, when dealing with numpy arrays,
    one may set equals=np.array_equal.
    R;   R8   s   Selected valuess   Selected labelss   Selected indicesR:   sñ   Iterable of values, (label, value) pairs, or a mapping of {label: value} pairs that the user can select.

    The labels are the strings that will be displayed in the UI, representing the
    actual Python choices, and should be unique.
    R<   s   The labels for the options.s   Enable or disable user changesc         O   s¡   | j  d d „  ƒ |  _ t |  _ t | j d d ƒ ƒ } | |  _ |  j d t d „  | Dƒ ƒ ƒ t d „  | Dƒ ƒ |  _	 t
 t |  ƒ j | | Ž  t |  _ d  S(   NR=   c         S   s
   |  | k S(   N(    (   R*   R-   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyR.   <  R/   R>   R?   c         s   s   |  ] } | d  Vq d S(   i    N(    (   R   R$   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>C  s    c         s   s   |  ] } | d  Vq d S(   i   N(    (   R   R$   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>D  s    (    (   RB   R=   RC   RD   R,   RE   t   _full_optionsRG   R"   RH   RJ   Rf   RK   RL   (   RM   RN   RO   R>   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRK   ;  s    		 R>   c         C   sS   t  | j t ƒ r: t  | j t ƒ r: t | j ƒ | _ n  t | j ƒ |  _ | j S(   N(   R    R1   R    R   R"   R,   RF   (   RM   RQ   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRR   I  s    %c         C   sa   |  j  } |  j d t d „  | Dƒ ƒ ƒ t d „  | Dƒ ƒ |  _ |  j t k	 r] d |  _ n  d S(   s   Unselect any optionR?   c         s   s   |  ] } | d  Vq d S(   i    N(    (   R   R$   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>U  s    c         s   s   |  ] } | d  Vq d S(   i   N(    (   R   R$   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>V  s    N(    (   RF   RG   R"   RH   RD   RC   R@   (   RM   RT   R>   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRU   Q  s
    	 R@   c            s6   t  ‡  f d †  | j Dƒ ƒ r& | j St d ƒ ‚ d S(   s'   Check the range of each proposed index.c         3   s4   |  ]* } d  | k o) t  ˆ  j ƒ k  n Vq d S(   i    N(   R#   R?   (   R   R$   (   RM   (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>]  s    s&   Invalid selection: index out of boundsN(   R)   R1   R   (   RM   RQ   (    (   RM   sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRV   Z  s    c            sx   t  ‡  f d †  | j Dƒ ƒ } t  ‡  f d †  | j Dƒ ƒ } ˆ  j | k rY | ˆ  _ n  ˆ  j | k rt | ˆ  _ n  d S(   s<   Propagate changes in index to the value and label propertiesc         3   s   |  ] } ˆ  j  | Vq d  S(   N(   R?   (   R   R$   (   RM   (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>e  s    c         3   s   |  ] } ˆ  j  | Vq d  S(   N(   RH   (   R   R$   (   RM   (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>f  s    N(   R"   RW   RA   R1   (   RM   RT   RA   R1   (    (   RM   sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRX   b  s    R1   c            sE   y! t  ‡  f d †  | j Dƒ ƒ SWn t k
 r@ t d ƒ ‚ n Xd S(   s>   Replace all values with the actual objects in the options listc         3   s'   |  ] } t  ˆ  j | ˆ  j ƒ Vq d  S(   N(   R6   RH   R=   (   R   R$   (   RM   (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>q  s    s"   Invalid selection: value not foundN(   R"   R1   R4   R   (   RM   RQ   (    (   RM   sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRY   m  s    !c            s>   t  ‡  f d †  | j Dƒ ƒ } ˆ  j | k r: | ˆ  _ n  d  S(   Nc         3   s!   |  ] } ˆ  j  j | ƒ Vq d  S(   N(   RH   R@   (   R   R$   (   RM   (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>w  s    (   R"   RW   R@   (   RM   RT   R@   (    (   RM   sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRZ   u  s    RA   c            s5   t  ‡  f d †  | j Dƒ ƒ r. t d ƒ ‚ n  | j S(   Nc         3   s   |  ] } | ˆ  j  k Vq d  S(   N(   R?   (   R   R$   (   RM   (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>}  s    s"   Invalid selection: label not found(   t   anyR1   R   (   RM   RQ   (    (   RM   sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyR[   {  s    c            s>   t  ‡  f d †  | j Dƒ ƒ } ˆ  j | k r: | ˆ  _ n  d  S(   Nc         3   s!   |  ] } ˆ  j  j | ƒ Vq d  S(   N(   R?   R@   (   R   R$   (   RM   (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>ƒ  s    (   R"   RW   R@   (   RM   RT   R@   (    (   RM   sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyR\     s    c         c   s>   t  t |  ƒ j ƒ  } x" t t | d ƒ ƒ D] } | Vq+ Wd  S(   NR>   (   R>   (   RJ   Rf   R]   R^   R   (   RM   R_   R`   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyR]   ‡  s    (    N(   Ra   Rb   Rc   R
   R   R1   R   RA   R   Rd   RC   R@   R>   RI   RF   R?   R   Re   RK   R   RR   R   RU   RV   RX   RY   RZ   R[   R\   R]   (    (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRf     s&   $		*		t   ToggleButtonsStylec           B   s\   e  Z d  Z e d ƒ j d e ƒ Z e d d ƒ j d e ƒ Z e d d ƒ j d e ƒ Z RS(   sD  Button style widget.

    Parameters
    ----------
    button_width: str
        The width of each button. This should be a valid CSS
        width, e.g. '10px' or '5em'.

    font_weight: str
        The text font weight of each button, This should be a valid CSS font
        weight unit, for example 'bold' or '600'
    t   ToggleButtonsStyleModelR:   R8   s   The width of each button.s    Text font weight of each button.(	   Ra   Rb   Rc   R   Rd   RC   t   _model_namet   button_widtht   font_weight(    (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRi   Ž  s   t   ToggleButtonsc        	   B   sÚ   e  Z d  Z e d ƒ j d e ƒ Z e d ƒ j d e ƒ Z e e ƒ  d d ƒj d e ƒ Z	 e e ƒ  d d ƒj d e ƒ Z
 e e ƒ j d e e  Z e d d d	 d
 d d d g d d d e d d ƒ j d e ƒ Z RS(   s¨  Group of toggle buttons that represent an enumeration.

    Only one toggle button can be toggled at any point in time.

    Parameters
    ----------
    {selection_params}

    tooltips: list
        Tooltip for each button. If specified, must be the
        same length as `options`.

    icons: list
        Icons to show on the buttons. This must be the name
        of a font-awesome icon. See `http://fontawesome.io/icons/`
        for a list of icons.

    button_style: str
        One of 'primary', 'success', 'info', 'warning' or
        'danger'. Applies a predefined style to every button.

    style: ToggleButtonsStyle
        Style parameters for the buttons.
    t   ToggleButtonsViewR:   t   ToggleButtonsModelR8   s   Tooltips for each button.sG   Icons names for each button (FontAwesome names without the fa- prefix).t   valuest   primaryt   successt   infot   warningt   dangerR/   t   default_valueR9   s)   Use a predefined styling for the buttons.(   Ra   Rb   Rc   R   Rd   RC   t
   _view_nameRk   R
   t   tooltipst   iconsR	   Ri   R   t   styleR   t   button_style(    (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRn   ¡  s   !!t   Dropdownc           B   s>   e  Z d  Z e d ƒ j d e ƒ Z e d ƒ j d e ƒ Z RS(   sn   Allows you to select a single item from a dropdown.

    Parameters
    ----------
    {selection_params}
    t   DropdownViewR:   t   DropdownModel(   Ra   Rb   Rc   R   Rd   RC   Rx   Rk   (    (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyR}   È  s   t   RadioButtonsc           B   s>   e  Z d  Z e d ƒ j d e ƒ Z e d ƒ j d e ƒ Z RS(   s°   Group of radio buttons that represent an enumeration.

    Only one radio button can be toggled at any point in time.

    Parameters
    ----------
    {selection_params}
    t   RadioButtonsViewR:   t   RadioButtonsModel(   Ra   Rb   Rc   R   Rd   RC   Rx   Rk   (    (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyR€   Õ  s   
t   Selectc           B   s\   e  Z d  Z e d ƒ j d e ƒ Z e d ƒ j d e ƒ Z e d d d ƒj d e ƒ Z	 RS(   sÇ   
    Listbox that only allows one item to be selected at any given time.

    Parameters
    ----------
    {selection_params}

    rows: int
        The number of rows to display in the widget.
    t
   SelectViewR:   t   SelectModeli   R8   s   The number of rows to display.(
   Ra   Rb   Rc   R   Rd   RC   Rx   Rk   R   t   rows(    (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRƒ   ä  s   t   SelectMultiplec           B   s\   e  Z d  Z e d ƒ j d e ƒ Z e d ƒ j d e ƒ Z e d d d ƒj d e ƒ Z	 RS(   s  
    Listbox that allows many items to be selected at any given time.

    The ``value``, ``label`` and ``index`` attributes are all iterables.

    Parameters
    ----------
    {multiple_selection_params}

    rows: int
        The number of rows to display in the widget.
    t   SelectMultipleViewR:   t   SelectMultipleModeli   R8   s   The number of rows to display.(
   Ra   Rb   Rc   R   Rd   RC   Rx   Rk   R   R†   (    (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyR‡   õ  s   t   _SelectionNonemptyc           B   sz   e  Z d  Z e d d ƒ Z e d d ƒ Z e d d ƒ j d e	 ƒ Z
 d „  Z e d ƒ d „  ƒ Z e d	 ƒ d
 „  ƒ Z RS(   s6   Selection that is guaranteed to have a value selected.R8   s   Selected values   Selected labels   Selected indexR:   c         O   sJ   t  | j d d ƒ ƒ d k r- t d ƒ ‚ n  t t |  ƒ j | | Ž  d  S(   NR>   i    s   options must be nonempty(    (   R#   RE   R   RJ   RŠ   RK   (   RM   RN   RO   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRK     s    R>   c         C   sw   t  | j t ƒ r: t  | j t ƒ r: t | j ƒ | _ n  t | j ƒ |  _ t |  j ƒ d k rp t d ƒ ‚ n  | j S(   Ni    s   Option list must be nonempty(	   R    R1   R    R   R"   R,   RF   R#   R   (   RM   RQ   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRR     s    %R@   c         C   s?   d | j  k o# t |  j ƒ k  n r/ | j  St d ƒ ‚ d  S(   Ni    s&   Invalid selection: index out of bounds(   R1   R#   R?   R   (   RM   RQ   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRV     s    ((   Ra   Rb   Rc   R   R1   R   RA   R   Rd   RC   R@   RK   R   RR   RV   (    (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRŠ   	  s   		t   _MultipleSelectionNonemptyc           B   s,   e  Z d  Z d „  Z e d ƒ d „  ƒ Z RS(   s9   Selection that is guaranteed to have an option available.c         O   sJ   t  | j d d ƒ ƒ d k r- t d ƒ ‚ n  t t |  ƒ j | | Ž  d  S(   NR>   i    s   options must be nonempty(    (   R#   RE   R   RJ   R‹   RK   (   RM   RN   RO   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRK   (  s    R>   c         C   sw   t  | j t ƒ r: t  | j t ƒ r: t | j ƒ | _ n  t | j ƒ |  _ t |  j ƒ d k rp t d ƒ ‚ n  | j S(   Ni    s   Option list must be nonempty(	   R    R1   R    R   R"   R,   RF   R#   R   (   RM   RQ   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRR   -  s    %(   Ra   Rb   Rc   RK   R   RR   (    (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyR‹   %  s   	t   SelectionSliderc           B   s§   e  Z d  Z e d ƒ j d e ƒ Z e d ƒ j d e ƒ Z e d d d g d d d d	 ƒ j d e ƒ Z	 e
 e d d
 ƒj d e ƒ Z e
 e d d ƒj d e ƒ Z RS(   sŽ   
    Slider to select a single item from a list or dictionary.

    Parameters
    ----------
    {selection_params}

    {slider_params}
    t   SelectionSliderViewR:   t   SelectionSliderModelRq   t
   horizontalt   verticalRw   R8   s   Vertical or horizontal.s5   Display the current selected label next to the slidersA   Update the value of the widget as the user is holding the slider.(   Ra   Rb   Rc   R   Rd   RC   Rx   Rk   R   t   orientationR   t   readoutt   continuous_update(    (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRŒ   7  s   		t   SelectionRangeSliderc           B   s  e  Z d  Z e d ƒ j d e ƒ Z e d ƒ j d e ƒ Z e d d ƒ Z	 e d d ƒ Z
 e d d d ƒj d e ƒ Z e d	 ƒ d
 „  ƒ Z e d ƒ d „  ƒ Z e d d d g d d d d ƒ j d e ƒ Z e e d d ƒj d e ƒ Z e e d d ƒj d e ƒ Z RS(   s  
    Slider to select multiple contiguous items from a list.
    
    The index, value, and label attributes contain the start and end of
    the selection range, not all items in the range.

    Parameters
    ----------
    {multiple_selection_params}

    {slider_params}
    t   SelectionRangeSliderViewR:   t   SelectionRangeSliderModelR8   s   Min and max selected valuess   Min and max selected labelsi    s   Min and max selected indicesR>   c         C   sa   |  j  } |  j d t d „  | Dƒ ƒ ƒ t d „  | Dƒ ƒ |  _ |  j t k	 r] d |  _ n  d S(   s   Select the first rangeR?   c         s   s   |  ] } | d  Vq d S(   i    N(    (   R   R$   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>h  s    c         s   s   |  ] } | d  Vq d S(   i   N(    (   R   R$   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>i  s    i    N(   i    i    (   RF   RG   R"   RH   RD   RC   R@   (   RM   RT   R>   (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRU   d  s
    	 R@   c            sn   t  | j ƒ d k r. t d | j f ƒ ‚ n  t ‡  f d †  | j Dƒ ƒ rT | j St d | j f ƒ ‚ d S(   sI   Make sure we have two indices and check the range of each proposed index.i   s8   Invalid selection: index must have two values, but is %rc         3   s4   |  ]* } d  | k o) t  ˆ  j ƒ k  n Vq d S(   i    N(   R#   R?   (   R   R$   (   RM   (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pys	   <genexpr>r  s    s*   Invalid selection: index out of bounds: %sN(   R#   R1   R   R)   (   RM   RQ   (    (   RM   sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyRV   m  s
    Rq   R   R   Rw   s   Vertical or horizontal.s5   Display the current selected label next to the slidersA   Update the value of the widget as the user is holding the slider.(   i    i    (   Ra   Rb   Rc   R   Rd   RC   Rx   Rk   R   R1   RA   R@   R   RU   R   RV   R   R‘   R   R’   R“   (    (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyR”   N  s   	
		N(8   Rc   t   collections.abcR    R   t   ImportErrort   collectionst	   itertoolsR   t   zipR   t   widget_descriptionR   R   t   valuewidgetR   t   widget_coreR   t   widget_styleR   t   trait_typesR	   R
   t   widgetR   R   t   docutilsR   t	   traitletsR   R   R   R   R   R   R   R   R   R   R   t   ipython_genutils.py3compatR   t   _doc_snippetsR,   R6   R7   Rf   Ri   Rn   R}   R€   Rƒ   R‡   RŠ   R‹   RŒ   R”   (    (    (    sB   lib/python2.7/site-packages/ipywidgets/widgets/widget_selection.pyt   <module>   sf   
L
"

	Žs%