ó
mÜJ]c           @` s“   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 d d l m Z d Z d	 e f d
 „  ƒ  YZ d S(   u_  
To generate a standalone HTML page for a Bokeh application from a single
Python script, pass the script name to ``bokeh html`` on the command
line:

.. code-block:: sh

    bokeh html app_script.py

The generated HTML will be saved in the current working directory with
the name ``app_script.html``.

It is also possible to run the same commmand with jupyter notebooks:

.. code-block:: sh

    bokeh html app_notebook.ipynb

This will generate an HTML file named ``app_notebook.html`` just like
with a python script.

Applications can also be created from directories. The directory should
contain a ``main.py`` (and any other helper modules that are required) as
well as any additional assets (e.g., theme files). Pass the directory name
to ``bokeh html`` to generate the HTML:

.. code-block:: sh

    bokeh html app_dir

It is possible to generate HTML pages for multiple applications at once:

.. code-block:: sh

    bokeh html app_script.py app_dir

If you would like to automatically open a browser to display the HTML
page(s), you can pass the ``--show`` option on the command line:

.. code-block:: sh

    bokeh html app_script.py app_dir --show

This will open two pages, for ``app_script.html`` and ``app_dir.html``,
respectively.

.. warning::
    Applications that use ``on_change`` callbacks require using the Bokeh
    server to execute the callback code.

i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsN(   t	   Resources(   t	   file_htmli   (   t   FileOutputSubcommandu   HTMLt   HTMLc           B` sf   e  Z d  Z d Z d Z d Z e j d ƒ d e d d d d ƒ f f e j	 ƒ  Z
 d	 „  Z d
 „  Z RS(   uB    Subcommand to output applications as standalone HTML files.

    u   htmlu9   Create standalone HTML files for one or more applicationsu   HTMLu   --showt   actionu
   store_truet   helpu#   Open generated file(s) in a browserc         C` s*   | j  r& d d l m } | | ƒ n  d S(   u
   

        i    (   t   viewN(   t   showt   bokeh.util.browserR
   (   t   selft   argst   filenamet   docR
   (    (    s=   lib/python2.7/site-packages/bokeh/command/subcommands/html.pyt   after_write_filev   s    	c         C` s"   t  d d d d ƒ } t | | ƒ S(   u
   

        t   modeu   cdnt   root_dirN(   R   t   NoneR   (   R   R   R   t	   resources(    (    s=   lib/python2.7/site-packages/bokeh/command/subcommands/html.pyt   file_contents~   s    (   t   __name__t
   __module__t   __doc__t   namet	   extensionR	   R   t	   files_argt   dictt
   other_argsR   R   R   (    (    (    s=   lib/python2.7/site-packages/bokeh/command/subcommands/html.pyR   ]   s   		(   u   HTML(   R   t
   __future__R    R   R   R   t   loggingt	   getLoggerR   t   logt   bokeh.resourcesR   t   bokeh.embedR   t   file_outputR   t   __all__R   (    (    (    s=   lib/python2.7/site-packages/bokeh/command/subcommands/html.pyt   <module>9   s   "