
    Vf                         d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZ G d dej                  ej                        Z
 ej                  e      Z ej                  dd       d Zd Zd	 Zed
k(  r e        yy)    Nc                       e Zd Zy)_CombinedFormatterN)__name__
__module____qualname__     k/var/www/html/software/conda/envs/catlas/lib/python3.12/site-packages/dash/development/update_components.pyr   r      s     	r	   r   z3%(asctime)s,%(msecs)03d %(levelname)s - %(message)sz%H:%M:%S)fmtdatefmtc                    t         j                  dk(  }| dk7  r| nd}d| d| d| }t        j                  ||       }t	        |       t        j                  |t
        j                  t
        j                  |      5 }|j                         \  }}	|j                         }
d d d        	r0t	        
rd	nd
|	j                         z   t         j                         
ss8t	        d| d|
 dt         j                         t        j                  d       y t	        d| dt         j                         y # 1 sw Y   xY w)Nwin32all4dash-core-components|dash-html-components|dash-tablenpx lerna exec --concurrency  --scope *@(z
)* -- npm posixstdoutstderrshell   🛑  fileu@   🚨 Failed installing npm dependencies for component packages: 	 (status=   ) 🚨   uB   🟢 Finished installing npm dependencies for component packages: u    🟢)sysplatformshlexsplitprint
subprocessPopenPIPEcommunicatepolldecoder   exit)components_sourceconcurrencyinstall_type
is_windowssource_globcmdstrcmdprocouterrstatuss              r
   bootstrap_componentsr7      s(   (J % 	C  -[Mk]R\]i\jkF
++f
N
3C	&M			JOOJOO:
 	##%S	 &wbCJJL8szzJSN{m[dekdllrs	
 	PQ\P]]bc	
! s    $D::Ec           	         t         j                  dk(  }| dk7  r| nd}d| d| d}t        j                  ||       }t	        |       t        j                  |t
        j                  t
        j                  |      5 }|j                         \  }}|j                         }	d d d        r0t	        	rd	nd
|j                         z   t         j                         	ss7t	        d| d|	 dt         j                         t        j                  d       |j                  d      D ]n  }
t        j                  j                  d|
|
j!                  dd      j#                  d            }|
dk(  rdn|
dk(  rdnd}t        j                  j                  d|      }t        j                  j%                  |      s	 t        j&                  |       t        j                  j%                  |      s(t	        dd|
 dz          t        j                  d       t	        d| d        t/        j0                  |       t/        j2                  ||       t5        t        j                  j                  |d!      d"d#$      5  	 d d d        t	        d%| d&       q y # 1 sw Y   xY w# t(        $ r/ t*        j-                  d|       t        j                  d       Y w xY w# 1 sw Y   dxY w)'Nr   r   r   r   r   z)* -- npm run buildr   r   r   r   r   u+   🚨 Finished updating component packages: r   r   r   |
components-_z/\zdash-core-componentsdcczdash-html-componentshtml
dash_tabledashu"   🚨 Having issues manipulating %suQ   🚨 Could not locate build artifacts. Check that the npm build process completedz successfully for package: u    🚨u!   🚚 Moving build artifacts from u    to Dash 🚚z.gitkeepwzutf-8)encodingu*   🟢 Finished moving build artifacts from u    to Dash 🟢)r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r   r+   ospathjoinreplacerstripexistsmakedirsOSErrorlogger	exceptionshutilrmtreecopytreeopen)r,   r-   r/   r0   r1   r2   r3   r4   r5   r6   packagebuild_directorydest_dir	dest_paths                 r
   build_componentsrU   ;   s   (J % 	C  -[Mk]RefF
++f
N
3C	&M			JOOJOO:
 	##%S	 &wbCJJL8szzJS9+iPVxW]^	
 	$$S) #_'',,'7??3#<#C#CE#J
 00  00  	 GGLL2	ww~~i(I&
 ww~~o.@/y>?
 HHQK5o5FmTUMM)$OOOY7bggll9j93Q >>O}]^G#_! D    !EyQ s*   >$J<J(>K#J%(4K K #K,	c                     t        j                  dt        d      } | j                  ddd       | j                  dt        d	d
       | j                  ddd       | j                         }t        |j                  |j                  |j                  dk(  rdnd       t        |j                  |j                         y )Nzdash-update-componentszUpdate the specified subcomponent libraries within Dash by copying over build artifacts, dependencies, and dependency metadata.)progformatter_classdescriptionr,   zA glob string that matches the Dash component libraries to be updated (eg.'dash-table' // 'dash-core-components|dash-html-components' // 'all'). The default argument is 'all'.r   )helpdefaultz--concurrency   zAMaximum concurrent steps, up to 3 (ie all components in parallel))typer[   rZ   z--ciz!For clean-install use '--ci True'FalseTruecii)argparseArgumentParserr   add_argumentint
parse_argsr7   r,   r-   r`   rU   )parserargss     r
   cliri      s    $$%*SF *    P	   0   D 0 0$''V:K$QT T++T-=-=>r	   __main__)r    r%   r"   rC   rb   rM   loggingcoloredlogsArgumentDefaultsHelpFormatterRawDescriptionHelpFormatterr   	getLoggerr   rK   installr7   rU   ri   r   r	   r
   <module>rq      s    
   	    	**H,P,P	 
		8	$   =z
!
HA_H?D zE r	   