o
    ٷi
                  
   @   s  U d dl Z d dlZd dlZd dlZd dlmZ d dlZd dlmZm	Z	 d dl
mZ d dlmZ edkrme jddZejd	d
dd e ZzedZe ZW d   n1 sZw   Y  e	eZed d Zdev ppdev Zesxed  ed d ZeeZed d d d Ze e! e"d< dd Z#e$eD ]tZ%e&ee%Z'e%(drqe)e're*e'ese*e'eree+e'j,Z-dd eD Z.e/e.d krdej01e-e'j2 3ej01edd4d Z5e5evre6e5 e7e% dej01e-e'j2  dej01e-e'j8  de'9   qqej:dkrBeed d d d< edd Ze;ee W d   W dS 1 s:w   Y  W dS W dS  e<yl Z= ze> \Z?Z?Z@e7d!e!e= d"e@jA  W Y dZ=[=dS dZ=[=ww dS )#    N)Path)dumpsparse)BlockContext)	Component__main__zDescription of your program)descriptionz-mz--modezBuild mode or dev mode)helpz../pyproject.tomlprojectkeywordszgradio-custom-componentzgradio custom componentnametoolhatchbuild	artifactsc                 C   s0   t jttj|  t jt  ddS )N /)	ospathabspathr   __file__parentreplacegetcwdlstrip)r    r   ]/home/ubuntu/.local/lib/python3.10/site-packages/gradio/_frontend_code/preview/src/examine.pyget_relative_path"   s   r   __c                 C   s.   g | ]}t td | t ttj kr|qS )..)r   r   file_locationvalueTEMPLATE_DIR).0xr   r   r   
<listcomp>3   s    r%   r   r   r   z~|~|~|~wz|EXCEPTION|:z, examine.py line )Bargparse	importlibinspectr   pathlibr   systomlkitr   r   gradio.blocksr   gradio.componentsr   __name__ArgumentParserparseradd_argument
parse_argsargsopenfreadpyproject_sourcepyproject_tomlr   custom_componentexitmodule_nameimport_modulemoduler   liststr__annotations__r   dirr   getattrr!   
startswithisclass
issubclassgetfiler   r    foundlenr   r   r"   r   r   artifactappendprintFRONTEND_DIRget_component_class_idmodewrite	Exceptioneexc_info_exc_tb	tb_linenor   r   r   r   <module>   s   
 




 


8((