B
    ‹æ@\ß  ã               @   sR   d Z ddlmZmZmZmZ ddlZe e¡Z	ddl
mZ dZG dd„ deƒZdS )	zO Utilities for specifying, validating, and documenting configuration
options.

é    )Úabsolute_importÚdivisionÚprint_functionÚunicode_literalsNé   )ÚHasProps)ÚOptionsc                   s"   e Zd ZdZd‡ fdd„	Z‡  ZS )r   aT   Leverage the Bokeh properties type system for specifying and
    validating configuration options.

    Subclasses of ``Options`` specify a set of configuration options
    using standard Bokeh properties:

    .. code-block:: python

        class ConnectOpts(Options):

            host = String(default="127.0.0.1", help="a host value")

            port = Int(default=5590, help="a port value")

    Then a ``ConnectOpts`` can be created by passing a dictionary
    containing keys and values corresponding to the configuration options,
    as well as any additional keys and values. The items corresponding
    to the properties on ``ConnectOpts`` will be ***removed*** from the
    dictionary. This can be useful for functions that accept their own
    set of config keyword arguments in addition to some set of Bokeh model
    properties.

    Nc                sB   i }x&|   ¡ D ]}||kr| |¡||< qW tt| ƒjf |Ž d S )N)Z
propertiesÚpopÚsuperr   Ú__init__)ÚselfÚkwZpropsÚk)Ú	__class__© ú1lib/python3.7/site-packages/bokeh/util/options.pyr   D   s
    zOptions.__init__)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__classcell__r   r   )r   r   r   +   s   r   )r   Z
__future__r   r   r   r   ZloggingZ	getLoggerr   ÚlogZcore.has_propsr   Ú__all__r   r   r   r   r   Ú<module>
   s   
