U
    /e2                     @  s   d Z ddlmZ ddlZeeZddlZddl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 d	d
lmZmZ dZdddddZddddddZG dd deZdS )a  

To display information about Bokeh and Bokeh server configuration,
type ``bokeh info`` on the command line.

.. code-block:: sh

    bokeh info

This will print general information to standard output, such as Python and Bokeh versions:

.. code-block:: none

    Python version      :  3.9.7 | packaged by conda-forge | (default, Sep 29 2021, 19:20:46)
    IPython version     :  7.20.0
    Tornado version     :  6.1
    Bokeh version       :  3.0.0
    BokehJS static path :  /opt/anaconda/envs/test/lib/python3.9/site-packages/bokeh/server/static
    node.js version     :  v16.12.0
    npm version         :  7.24.2
    Operating system    :  Linux-5.11.0-40-generic-x86_64-with-glibc2.31

Sometimes it can be useful to get just paths to the BokehJS static files in order
to configure other servers or processes. To do this, use the ``--static`` option

.. code-block:: sh

    bokeh info --static

This will produce output like what is shown below

.. code-block:: none

    /opt/anaconda/envs/test/lib/python3.9/site-packages/bokeh/server/static

    )annotationsN)	Namespace)__version__)settings)nodejs_versionnpmjs_version)import_optional   )Argument
Subcommand)Infoz
str | Nonestr)version_or_nonereturnc                 C  s   | pdS )zy helper method to optionally return module version number or not installed

    :param version_or_none:
    :return:
    z(not installed) )r   r   r   B/tmp/pip-unpacked-wheel-f5fndrjf/bokeh/command/subcommands/info.pyif_installedR   s    r   )module_nameattrr   c                 C  s   t | }|rt||S d S )N)r   getattr)r   r   moduler   r   r   _versionZ   s    r   c                   @  s:   e Zd ZdZdZdZdedddffZdd	d
ddZdS )r   zR Subcommand to print information about Bokeh and Bokeh server configuration.

    infoz<Print information about Bokeh and Bokeh server configurationz--static
store_truez+Print the locations of BokehJS static files)actionhelpr   None)argsr   c                 C  s   |j rtt  nd}tdtj|d   tdttdd  tdttdd	  td
t	  tdt   tdtt
   tdtt   tdt   dS )z


        
zPython version      :  r   zIPython version     :  ZIPythonr   zTornado version     :  ZtornadoversionzBokeh version       :  zBokehJS static path :  znode.js version     :  znpm version         :  zOperating system    :  N)Zstaticprintr   Z
bokehjsdirsysr   splitr   r   r   r   r   platform)selfr   newliner   r   r   invokeu   s    zInfo.invokeN)	__name__
__module____qualname____doc__namer   r
   r   r&   r   r   r   r   r   b   s   	r   )r*   
__future__r   logging	getLoggerr'   logr#   r!   argparser   Zbokehr   Zbokeh.settingsr   Zbokeh.util.compilerr   r   Zbokeh.util.dependenciesr   
subcommandr
   r   __all__r   r   r   r   r   r   r   <module>   s   (
