
mJ]c        5   @` sM  d  Z  d d l m Z m Z m Z m Z d d l Z e j e  Z	 d d l
 m Z d d l m Z m Z dZ d< e f d=     YZ d>   Z e d? d@ dA  Z e dB dC dD dE d@ dF dG dH dI 	 Z e dJ dK  Z e dL dM dN dO dP  Z e dQ dR dS dT dU  Z e dV dW dX dY dZ d[ d\ d] d^ d_ d` da  Z e db dc dd de df dg dh di dj dk 
 Z e dl dm  Z e dl dm dn  Z e do dp  Z e dq dr ds dt  Z dddddddddddddddddf Z e e e  e    d   Z! e d e" e e  e    d  Z# e d d  Z$ e d d  Z% e d dq  Z& e d d  Z' e d d d  Z( e Z) e d d d  Z* e dQ dR dS dT dU  Z+ e d d d  Z, e d d d d  Z- e d d d d  Z. e d d d d d d d d d d d d d d d  Z/ e d e0 e j1 j  Z2 e d d d d d d d d d d d d d d d d d d d d d d d d d d d d  Z3 e d d  Z4 e d d d  Z5 e d d  Z6 e e j7   Z8 e d d d d d  Z9 e d d  Z: e d d  Z; e d d d d d d  Z< e d d d d d d d  Z= e d d d d  Z> e d d d  Z? e d d  Z@ e d d  ZA e d? dA  ZB e d d d@  ZC e d d d@  ZD e d d d ddd ZE e dddd ZF e d d ddq  ZG e d d d d d d  ZH e d	d
d ZI e dd d dd  ZJ e d d d  ZK e d d  ZL d S(   u   Common enumerations to be used together with |Enum| property.

This module provides many pre-defined enumerations, as well as functions
for creating new enumerations.

New enumerations can be created using the |enumeration| function:

.. code-block:: python

    #: Specify a nautically named side, port or starboard
    MyEnum = enumeration("port", "starboard")

Typically, enumerations are used to define |Enum| properties:

.. code-block:: python

    from bokeh.model import Model
    from bokeh.core.properties import Enum

    class MyModel(Model):

        location = Enum(MyEnum, help="""
        Whether the thing should be a port or starboard.
        """)

Enumerations have a defined order and support iteration:

.. code-block:: python

    >>> for loc in MyEnum:
    ...     print(loc)
    ...
    port
    starboard

as well as containment tests:

.. code-block:: python

    >>> "port" in MyEnum
    True

Enumerations can be easily documented in Sphinx documentation with the
:ref:`bokeh.sphinxext.bokeh_enum` Sphinx extension.

----

.. autofunction:: bokeh.core.enums.enumeration

----

.. |Enum| replace:: :class:`~bokeh.core.properties.Enum`
.. |enumeration| replace:: :func:`~bokeh.core.enums.enumeration`

i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsN(   t   string_typesi   (   t   colorst   palettesu   Alignu   Anchoru
   AngleUnitsu
   ButtonTypeu   DashPatternu
   DateFormatu   DatetimeUnitsu	   Dimensionu
   Dimensionsu	   Directionu   Enumerationu   enumerationu	   FontStyleu   HatchPatternu   HatchPatternAbbreviationu
   HoldPolicyu   HorizontalLocationu   JitterRandomDistributionu   LatLonu   LegendClickPolicyu   LegendLocationu   LineCapu   LineDashu   LineJoinu   Locationu   MapTypeu
   MarkerTypeu
   NamedColoru   NumeralLanguageu   Orientationu   OutputBackendu   PaddingUnitsu   Paletteu   RenderLevelu
   RenderModeu   ResetPolicyu   RoundingFunctionu
   SizingModeu   SizingPolicyu   SliderCallbackPolicyu   SortDirectionu   SpatialUnitsu   StartEndu   StepModeu	   TextAlignu   TextBaselineu   TextureRepetitionu   TickLabelOrientationu   TooltipAttachmentu   TooltipFieldFormatteru   TrackPolicyu   VerticalAlignu   VerticalLocationt   Enumerationc           B` s>   e  Z d  Z d Z d   Z d   Z d   Z d   Z e Z RS(   u    Represent an enumerated collection of values.

    .. note::
        Instances of ``Enumeration`` typically should not be constructed
        directly. Instead, use the |enumeration| function.

    c         C` s   t  |  j  S(   N(   t   itert   _values(   t   self(    (    s/   lib/python2.7/site-packages/bokeh/core/enums.pyt   __iter__   s    c         C` s%   |  j  s | j   } n  | |  j k S(   N(   t   _case_sensitivet   lowerR	   (   R
   t   value(    (    s/   lib/python2.7/site-packages/bokeh/core/enums.pyt   __contains__   s    	c         C` s?   |  j  r' d d j d   |  j D  Sd d j |  j  Sd  S(   Nu   Enumeration(%s)u   , c         s` s   |  ] } t  |  Vq d  S(   N(   t   repr(   t   .0t   x(    (    s/   lib/python2.7/site-packages/bokeh/core/enums.pys	   <genexpr>   s    (   t   _quotet   joinR	   (   R
   (    (    s/   lib/python2.7/site-packages/bokeh/core/enums.pyt   __str__   s    	c         C` s   t  |  j  S(   N(   t   lenR	   (   R
   (    (    s/   lib/python2.7/site-packages/bokeh/core/enums.pyt   __len__   s    (    (	   t   __name__t
   __module__t   __doc__t	   __slots__R   R   R   R   t   __repr__(    (    (    s/   lib/python2.7/site-packages/bokeh/core/enums.pyR      s   				c          O` s   |  o t  d   |  D  s/ t d |    n  t |   t t |    k r` t d |    n  d   |  D } | j i t |   d 6|  d d 6| j d t  d	 6| j d
 t  d 6 t	 t
 d  t f |    S(   u   Create an |Enumeration| object from a sequence of values.

    Call ``enumeration`` with a sequence of (unique) strings to create an
    Enumeration object:

    .. code-block:: python

        #: Specify the horizontal alignment for rendering text
        TextAlign = enumeration("left", "right", "center")

    Args:
        values (str) : string enumeration values, passed as positional arguments

            The order of arguments is the order of the enumeration, and the
            first element will be considered the default value when used
            to create |Enum| properties.

    Keyword Args:
        case_sensitive (bool, optional) :
            Whether validation should consider case or not (default: True)

        quote (bool, optional):
            Whther values should be quoted in the string representations
            (default: False)

    Raises:
        ValueError if values empty, if any value is not a string or not unique

    Returns:
        Enumeration

    c         s` s$   |  ] } t  | t  o | Vq d  S(   N(   t
   isinstanceR   (   R   R   (    (    s/   lib/python2.7/site-packages/bokeh/core/enums.pys	   <genexpr>   s    u0   expected a non-empty sequence of strings, got %su(   enumeration items must be unique, got %sc         S` s   i  |  ] } | |  q S(    (    (   R   R   (    (    s/   lib/python2.7/site-packages/bokeh/core/enums.pys
   <dictcomp>   s   	 u   _valuesi    u   _defaultu   case_sensitiveu   _case_sensitiveu   quoteu   _quoteu   Enumeration(   t   allt
   ValueErrorR   t   sett   updatet   listt   gett   Truet   Falset   typet   strR   (   t   valuest   kwargst   attrs(    (    s/   lib/python2.7/site-packages/bokeh/core/enums.pyt   enumeration   s    !	u   startu   centeru   endu   top_leftu
   top_centeru	   top_rightu   center_leftu   center_rightu   bottom_leftu   bottom_centeru   bottom_rightu   degu   radu   defaultu   primaryu   successu   warningu   dangeru   solidu   dashedu   dottedu   dotdashu   dashdotu   ATOMu   W3Cu   RFC-3339u   ISO-8601u   COOKIEu   RFC-822u   RFC-850u   RFC-1036u   RFC-1123u   RFC-2822u   RSSu	   TIMESTAMPu   microsecondsu   millisecondsu   secondsu   minsecu   minutesu   hourminu   hoursu   daysu   monthsu   yearsu   widthu   heightu   bothu   clocku	   anticlocku   normalu   italicu   boldu   bold italicu    u   blanku   .u   dotu   ou   ringu   -u   horizontal_lineu   |u   vertical_lineu   +u   crossu   "u   horizontal_dashu   :u   vertical_dashu   @u   spiralu   /u   right_diagonal_lineu   \u   left_diagonal_lineu   xu   diagonal_crossu   ,u   right_diagonal_dashu   `u   left_diagonal_dashu   vu   horizontal_waveu   >u   vertical_waveu   *u   criss_crossi   t   quoteu   combineu   collectu   leftu   rightu   uniformu   latu   lonu   noneu   hideu   muteu   buttu   roundu   squareu   miteru   bevelu   aboveu   belowu	   satelliteu   roadmapu   terrainu   hybridu   asterisku   circleu   circle_crossu   circle_xu   dashu   diamondu   diamond_crossu   hexu   inverted_triangleu   square_crossu   square_xu   trianglet   case_sensitiveu   be-nlu   chsu   csu   da-dku   de-chu   deu   enu   en-gbu   es-ESu   esu   etu   fiu   fr-CAu   fr-chu   fru   huu   itu   jau   nl-nlu   plu   pt-bru   pt-ptu   ruu   ru-UAu   sku   thu   tru   uk-UAu
   horizontalu   verticalu   canvasu   svgu   webglu   percentu   absoluteu   imageu   underlayu   glyphu
   annotationu   overlayu   cssu   standardu
   event_onlyu   nearestu   flooru	   rounddownu   ceilu   roundupu   stretch_widthu   stretch_heightu   stretch_bothu   scale_widthu   scale_heightu
   scale_bothu   fixedu   fitu   minu   maxu
   continuousu   throttleu   mouseupu	   ascendingu
   descendingu   screenu   datau   beforeu   afteru   topu   middleu   bottomu
   alphabeticu   hangingu   ideographicu   repeatu   repeat_xu   repeat_yu	   no_repeatu   parallelu   numeralu   datetimeu   printfu   autou   flex(5   u   Alignu   Anchoru
   AngleUnitsu
   ButtonTypeu   DashPatternu
   DateFormatu   DatetimeUnitsu	   Dimensionu
   Dimensionsu	   Directionu   Enumerationu   enumerationu	   FontStyleu   HatchPatternu   HatchPatternAbbreviationu
   HoldPolicyu   HorizontalLocationu   JitterRandomDistributionu   LatLonu   LegendClickPolicyu   LegendLocationu   LineCapu   LineDashu   LineJoinu   Locationu   MapTypeu
   MarkerTypeu
   NamedColoru   NumeralLanguageu   Orientationu   OutputBackendu   PaddingUnitsu   Paletteu   RenderLevelu
   RenderModeu   ResetPolicyu   RoundingFunctionu
   SizingModeu   SizingPolicyu   SliderCallbackPolicyu   SortDirectionu   SpatialUnitsu   StartEndu   StepModeu	   TextAlignu   TextBaselineu   TextureRepetitionu   TickLabelOrientationu   TooltipAttachmentu   TooltipFieldFormatteru   TrackPolicyu   VerticalAlignu   VerticalLocation(   u    u   blank(   u   .u   dot(   u   ou   ring(   u   -u   horizontal_line(   u   |u   vertical_line(   u   +u   cross(   u   "u   horizontal_dash(   u   :u   vertical_dash(   u   @u   spiral(   u   /u   right_diagonal_line(   u   \u   left_diagonal_line(   u   xu   diagonal_cross(   u   ,u   right_diagonal_dash(   u   `u   left_diagonal_dash(   u   vu   horizontal_wave(   u   >u   vertical_wave(   u   *u   criss_cross(M   R   t
   __future__R    R   R   R   t   loggingt	   getLoggerR   t   logt   sixR   t    R   R   t   __all__t   objectR   R+   t   Alignt   Anchort
   AngleUnitst
   ButtonTypet   DashPatternt
   DateFormatt   DatetimeUnitst	   Dimensiont
   Dimensionst	   Directiont	   FontStylet   _hatch_patternsR"   t   zipt   HatchPatternR$   t   HatchPatternAbbreviationt
   HoldPolicyt   HorizontalLocationt   JitterRandomDistributiont   LatLont   LegendClickPolicyt   LegendLocationt   LineCapt   LineDasht   LineJoint   Locationt   MapTypet
   MarkerTypeR%   t   namedt
   NamedColort   NumeralLanguaget   Orientationt   OutputBackendt   PaddingUnitst   __palettes__t   Palettet   RenderLevelt
   RenderModet   ResetPolicyt   RoundingFunctiont
   SizingModet   SizingPolicyt   SliderCallbackPolicyt   SortDirectiont   SpatialUnitst   StartEndt   StepModet	   TextAlignt   TextBaselinet   TextureRepetitiont   TickLabelOrientationt   TooltipAttachmentt   TooltipFieldFormattert   TrackPolicyt   VerticalAlignt   VerticalLocation(    (    (    s/   lib/python2.7/site-packages/bokeh/core/enums.pyt   <module>=   s  "	                                                    	2			"		