
    ,j                     ~    d Z ddlZddlZddlZddlmZ  ej        d          Zd Zd Z	e
dk    r e	             dS dS )z
From the directory containing the static content for a trame application to work,
generate another application specific HTML file.
    N)Pathzdata-app-name="\w+"c                 8   t          | d          5 }|                                }t                              d| d|          }t          |d          5 }|                    |           d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Nrzdata-app-name=""w)openreadAPP_PATTERNsubwrite)
input_fileoutput_fileapp_namef_incontentpatched_contentf_outs          I/DATA/AppData/hermes/venv/lib/python3.11/site-packages/trame/tools/app.pycreate_app_filer      s   	j#		 )$))++%//*GH*G*G*GQQ+s## 	)uKK(((	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	)) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )s6   ABA7+B7A;	;B>A;	?BBBc                  f   t          j        d          } |                     ddd           |                     dd	           |                                 \  }}t	          |j                  }|                                s(|                                  t          j	        d
           |
                                r|dz  }|                                s(|                                  t          j	        d
           |                    |j                  }t          |||j                   d S )Nz.HTML app file generator for trame applications)descriptionz--nametramez2Application name to encode inside HTML {name}.html)defaulthelpz--inputzInput file to use as template)r   r   z
index.html)argparseArgumentParseradd_argumentparse_known_argsr   inputexists
print_helpsysexitis_dir	with_stemnamer   )parserargs_r   r   s        r   mainr*      sD   $D  F A     ,    
 %%''GD! dj!!J  /,.
 &&ty11KJTY77777    __main__)__doc__r   rer"   pathlibr   compiler
   r   r*   __name__ r+   r   <module>r3      s    
  				 



      bj/00) ) ) 8  8  8F zDFFFFF r+   