
    u×g                        d dl 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dlmZ ddlmZ dd	lmZ d
Zddddd	 	 	 	 	 	 	 	 	 	 	 ddZddddddZdddZy)    )annotationsN)fspath)Popen   )__version__)PathLike)settings)_nodejs_path)initbuildF)interactiveverbosebokehjs_versiondebugc                   g }|r|j                  d       |r|j                  d       |r|j                  d|g       t        d| ||      }|j                  dk(  S )a   Initialize a directory as a new bokeh extension.

    Arguments:
        base_dir (str) : The location of the extension.

        interactive (bool) : Guide the user step-by-step.

        verbose (bool) : Display detailed build information.

        bokehjs_version (str) : Use a specific version of bokehjs.

        debug (bool) : Allow for remote debugging.

    Returns:
        bool

    z--interactive	--verbosez--bokehjs-versionr   r   )appendextend_run_command
returncode)base_dirr   r   r   r   argsprocs          )lib/python3.12/site-packages/bokeh/ext.pyr   r   (   s[    2 DO$K (/:;$6D??a    )rebuildr   r   c                   g }|r|j                  d       |r|j                  d       t        d| ||      }|j                  dk(  S )aM   Build a bokeh extension in the given directory.

    Arguments:
        base_dir (str) : The location of the extension.

        rebuild (bool) : Ignore caches and rebuild from scratch.

        verbose (bool) : Display detailed build information.

        debug (bool) : Allow for remote debugging.

    Returns:
        bool

    z	--rebuildr   r   r   )r   r   r   )r   r   r   r   r   r   s         r   r   r   L   sF      DK K 47D??ar   c           	     D   t        j                         }|r|dz  dz  dz  }n|dz  dz  }dt        |      | dt        |      dt        |      dt        g	}|r|j	                  d	d
       |j                  |       t        t               g|      }|j                          |S )Njscompilerzmain.jszcompiler.jsz--no-deprecationz
--base-dirz--bokehjs-dirz--bokeh-versionr   z--inspect-brk)	r	   bokehjs_pathr   r   insertr   r   r
   communicate)commandr   r   r   bokehjs_dircompiler_scriptcmdr   s           r   r   r   l   s    '')K%,z9IE%,}< 	fX&,;C 

1o&JJt,.'3'(DKr   )r   r   r   boolr   r(   r   z
str | Noner   r(   returnr(   )
r   r   r   r(   r   r(   r   r(   r)   r(   )F)
r$   strr   r   r   z	list[str]r   r(   r)   zPopen[bytes])
__future__r   logging	getLogger__name__logosr   
subprocessr    r   
core.typesr   r	   util.compilerr
   __all__r   r   r    r   r   <module>r7      s    # g!       '  "&! !  !  	! 
  !  !  
! H 27]b  @r   