U
    öÕ/eÛ  ã                   @  sV   d Z ddlmZ ddlZe e¡ZddlmZm	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.

é    )ÚannotationsN)ÚAnyÚDicté   )ÚHasProps)ÚOptionsc                      s(   e Zd ZdZdd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.

    zDict[str, Any]ÚNone)ÚkwÚreturnc                   s:   i }|   ¡ D ]}||kr| |¡||< qtƒ jf |Ž d S )N)Z
propertiesÚpopÚsuperÚ__init__)Úselfr	   ÚpropsÚk©Ú	__class__© ú6/tmp/pip-unpacked-wheel-f5fndrjf/bokeh/util/options.pyr   C   s
    zOptions.__init__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__classcell__r   r   r   r   r   *   s   r   )r   Ú
__future__r   ÚloggingÚ	getLoggerr   ÚlogÚtypingr   r   Zcore.has_propsr   Ú__all__r   r   r   r   r   Ú<module>   s   
