
    e-                         d Z ddl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 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Zedk    r e             dS dS )z 
Commandline interface to Panel
    N)main)Serve)die)	nice_join   )__version__   )Bundle)Convert)OAuthSecretc                 4   dddd}dt           j        v rdt           j        d<   g }d}| D ]m}|rd}||                                v r|                    ||                    9|d	k    rd
}B|                    d          rX|                    |           n|S )z
    Allows usage with anaconda-project by remapping the argv list provided
    into arguments accepted by Bokeh 0.12.7 or later.
    z--allow-websocket-originz--portz	--address)z--anaconda-project-hostz--anaconda-project-portz--anaconda-project-addressPANEL_AE5_CDNcdnBOKEH_RESOURCESFz--anaconda-project-iframe-hostsTz--anaconda-project)osenvironkeysappend
startswith)argvreplacementstransformedskipargs        6lib/python3.11/site-packages/panel/command/__init__.pytransform_cmdsr      s     #=#+&1 L
 "*$$(-
$%KD $ $ 	D,##%%%%|C01111555D^^011 	$s####    c                 	   ddl m} |t          t          t          gz   }t          j        dd          }|                    dddt          	           |	                    d
          }|D ]E}|t          u rW|                    t          j        t          j                  }t          |          }|                    |j                   c|t          u rW|                    t          j        t          j                  }t          |          }|                    |j                   |t          u rX|                    t          j        t          j                  }t	          |          }|                    |j                   $|                    |j        |j                   Gt#          t$          j                  dk    r8t)          d |D                       }t+          dt-          |          z             t$          j        d         dv rO|                    t$          j        dd                   } |                     |            t%          j                     t#          t$          j                  dk    rt3          d |D                       rt5          t$          j                  t$          _        t$          j        d         dk    rv|                    t$          j        dd                   } 	 |                     |           }n{# t6          $ r*}	t+          dt9          |	          z              Y d}	~	nLd}	~	ww xY wt$          j        d         dk    r$t          |                              |           }n
t$          j        d         dk    rJ|                    t$          j        dd                   } t          |                              |           }nt$          j        d         dk    rJ|                    t$          j        dd                   } t	          |                              |           }nJt;                      }n;|                    t$          j        dd                    t%          j        d           |du rt%          j        d           dS |dur1t=          |t>                    r|dk    rt%          j        |           dS dS dS dS )z>Mirrors bokeh CLI and adds additional Panel specific commands r   )allpanelz;See '<command> --help' to read about a specific subcommand.)progepilogz-vz	--versionversion)actionr#   zSub-commands)help)parser)invoker	   c                     g | ]	}|j         
S  )name.0cs     r   
<listcomp>zmain.<locals>.<listcomp>Q   s    >>>!qv>>>r   z*ERROR: Must specify subcommand, one of: %s)z--helpz-hNc              3   L   K   | ]}t           j        d          |j        k    V   dS )r	   N)sysr   r*   r+   s     r   	<genexpr>zmain.<locals>.<genexpr>Y   s/       O O1!!6 O O O O O Or   servezERROR: zoauth-secretconvertbundleFT) bokeh.command.subcommandsr   r   r   r
   argparseArgumentParseradd_argumentr   add_subparsersBkServe
add_parserr   r*   r%   set_defaultsr'   lenr0   r   sortedr   r   
parse_argsexitanyr   	Exceptionstrbokeh_entry_point
isinstanceint)
argsbokeh_commandsr&   subscls	subparser
subcommandall_commandsretes
             r   r   r   3   sE   ??????#{GV&DDN$Z  F k)[QQQ  n 55D 5 5'>>
DDIi000J""**;"<<<<G^^7<HHI 	222J""**;"<<<<F]]&+FFIy111J""**;"<<<<OOCH38O4444
38}}>>~>>>??89\;R;RRSSS
x{&&&  !""..D



38}}qS O O O O OOO!#(++8A;'!!$$SXabb\22D(kk$'' ( ( (IA&''''''''(Xa[N**f%%,,T22CCXa[I%%$$SXabb\22D&//((..CCXa[H$$$$SXabb\22D..''--CC#%%CC#(122,'''
e||	DZS11cQhh 
hhs   L 
M#MM__main__)N)__doc__r6   r   r0   bokeh.__main__r   rD   bokeh.command.subcommands.server   r:   bokeh.command.utilr   bokeh.util.stringsr    r   r4   r
   r3   r   oauth_secretr   r2   r   __name__r)   r   r   <module>rY      s     				 



 4 4 4 4 4 4 < < < < < < " " " " " " ( ( ( ( ( (                   % % % % % %        >? ? ? ?F zDFFFFF r   