
    Mf                         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             dS dS )    Nc                       e Zd ZdS )_CombinedFormatterN)__name__
__module____qualname__     a/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/dash/development/update_components.pyr   r      s         	Dr	   r   z3%(asctime)s,%(msecs)03d %(levelname)s - %(message)sz%H:%M:%S)fmtdatefmtc                    t           j        dk    }| dk    r| nd}d| d| d| }t          j        ||           }t	          |           t          j        |t
          j        t
          j        |          5 }|                                \  }}	|	                                }
d d d            n# 1 swxY w Y   |	r4t	          |
rd	nd
|	
                                z   t           j                   |
s|s8t	          d| d|
 dt           j                   t          j        d           d S t	          d| dt           j                   d S )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  l[kkkkk]ikkF
+f
N
3
3
3C	&MMM		JOJO:
 
 
 	##%%S	                K&(wwbCJJLL8szJJJJ 

S 

s{sseksss	
 	
 	
 	
 	cQ\ccc	
 	
 	
 	
 	
 	
s   8,B00B47B4c           	      ,   t           j        dk    }| dk    r| nd}d| d| d}t          j        ||           }t	          |           t          j        |t
          j        t
          j        |          5 }|                                \  }}|	                                }	d d d            n# 1 swxY w Y   |r4t	          |	rd	nd
|
                                z   t           j                   |	s|s6t	          d| d|	 dt           j                   t          j        d           |                    d          D ]}
t          j                            d|
|
                    dd                              d                    }|
dk    rdn	|
dk    rdnd}t          j                            d|          }t          j                            |          sU	 t          j        |           n?# t(          $ r2 t*                              d|           t          j        d           Y nw xY wt          j                            |          s,t	          dd|
 dz              t          j        d           <t	          d| d            t/          j        |           t/          j        ||           t5          t          j                            |d!          d"d#$          5  	 d d d            n# 1 swxY w Y   t	          d%| d&           d S )'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  g[ffkfffF
+f
N
3
3
3C	&MMM		JOJO:
 
 
 	##%%S	                K&(wwbCJJLL8szJJJJ S ^+^^PV^^^	
 	
 	
 	
 	$$S)) #_ #_',,'7??3#<#<#C#CE#J#J
 
 000 E 000  	 GLL22	w~~i(( 	I&&&&     !EyQQQ w~~o.. 	_@>>>>?  
 HQKKKKToTTTUUUM)$$$OOY777bgll9j993QQQ                ]]]]^^^^G#_ #_s6   6,B..B25B2G009H,+H,&K44K8	;K8	c                     t          j        dt          d          } |                     ddd           |                     dt          d	d
           |                     ddd           |                                 }t          |j        |j        |j	        dk    rdnd           t          |j        |j                   d S )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$'V:K: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	 	 	 
	8	$	$  =z   
!
 !
 !
HA_ A_ A_H? ? ?D zCEEEEE r	   