
     "j                        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dd	d
Zd Z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__     ^/var/www/html/bolsaweb/venv/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datefmtdcchtml
dash_table)zdash-core-componentszdash-html-componentsz
dash-tablec                     	 t          | fi | d S # t          $ r% t          |                     dd          fi | Y d S w xY w)Nasciiignore)printUnicodeEncodeErrorencode)msgkwargss     r
   status_printr      sk    7cV 7 7 7cjj(++66v6666667s    +A A 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|s8t	          d| d|
 dt           j                   t          j        d           d S t	          d| dt           j                   d S )Nwin32all6{dash-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splitr   
subprocessPopenPIPEcommunicatepolldecoder#   exit)components_sourceconcurrencyinstall_type
is_windowssource_globcmdstrcmdprocouterrstatuss              r
   bootstrap_componentsrB   $   s   (J %% 	E  i[hhKhhZfhhF
+f
N
3
3
3C		JOJO:
 
 
 	##%%S	                R/ggR3::<<?cjQQQQ 

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|v r4|                    d          d                             d          d         }|                    d          D ]}
t          j                            d|
|
                    dd                              d                    }t$                              |
          p|
}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           Ft	          d| d           t3          j        |           t3          j        ||           t9          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+   {}r   ,
components-_z/\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   r0   r1   r2   r3   r4   r5   r#   r6   ospathjoinreplacerstripdest_dir_mapgetexistsmakedirsOSErrorlogger	exceptionshutilrmtreecopytreeopen)r7   r8   r:   r;   r<   r=   r>   r?   r@   rA   packagebuild_directorydest_dir	dest_paths                 r
   build_componentsra   H   s   (J %% 	E  d[ccKcccF
+f
N
3
3
3C		JOJO:
 
 
 	##%%S	                R/ggR3::<<?cjQQQQ S ^+^^PV^^^	
 	
 	
 	
 	
k!'',,Q/55c::1=$$S))  ',,'7??3#<#<#C#CE#J#J
 
  ##G,,7GLL22	w~~i(( 	I&&&&     !EyQQQ w~~o.. 	@>>>>?  
 HQKKKK[_[[[\\\M)$$$OOY777bgll9j993QQQ                [_[[[   ; s6   6,B..B25B2H229I.-I.(L66L:	=L:	c                     t          j        dt          d          } |                     ddd           |                     dt          d	d
           |                     ddd           |                                 }t          j        dk    r4|j        	                    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descriptionr7   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))typerg   rf   z--ciz!For clean-install use '--ci True'Falser   "r&   'Truecii)argparseArgumentParserr   add_argumentint
parse_argsr,   r-   r7   rP   rB   r8   rn   ra   )parserargss     r
   clirw      sD   $%*S  F *      P	     0     D
|w!%!7!?!?R!H!H!P!P"
 "
  0$'V:K:K$$QT   T+T-=>>>>>r	   __main__)r,   r0   r.   rM   rp   rY   loggingcoloredlogsArgumentDefaultsHelpFormatterRawDescriptionHelpFormatterr   	getLoggerr   rW   installrR   r   rB   ra   rw   r   r	   r
   <module>r      s8   



      				       	 	 	 	 	*H,P	 	 	 
	8	$	$  =z   
 "" 7 7 7!
 !
 !
H@ @ @F$? $? $?N zCEEEEE r	   