HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib64/python3.10/site-packages/mako/__pycache__/cmd.cpython-310.pyc
o

%we�
�@s�ddlmZddlmZddlmZddlZddlmZddlm	Z	ddl
mZdd	�Zd
d�Z
ddd
�Zedkr>e�dSdS)�)�ArgumentParser)�dirname)�isfileN)�
exceptions)�TemplateLookup)�TemplatecCsd|vr|dfS|�dd�S)N�=��)�split)�var�r
�A/home/arjun/projects/env/lib/python3.10/site-packages/mako/cmd.py�varsplitsrcCs"tj�t�����t�d�dS)Nr
)�sys�stderr�writer�text_error_template�render�exitr
r
r
r�_exitsrcCstt�}|jdgddd�|jdgddd�|jdddd	�|jd
ddd	�|jdd
dd�|�|�}|j}|j}|jdkr\|jpBdg}t|�}ztt	j
��||d�}Wn2t�Yn*|j}t
|�sitd|��|jppt|�g}t|�}z	t|||d�}Wnt�Ytdd�|jD��}	z
|jdi|	��}
Wn	t�YdS|r�t|d|d��|
�dSt	j�|
�dS)Nz--var�appendz5variable (can be used multiple times, use name=value))�default�action�helpz--template-dirz�Directory to use for template lookup (multiple directories may be provided). If not given then if the template is read from stdin, the value defaults to be the current directory, otherwise it defaults to be the parent directory of the file provided.z--output-encodingzforce output encoding)rrz
--output-filez6Write to file upon successful render instead of stdout�input�?�-)�nargsr�.)�lookup�output_encodingzerror: can't find %s)�filenamer r!css�|]}t|�VqdS�N)r)�.0rr
r
r�	<genexpr>Vs�zcmdline.<locals>.<genexpr>�wt)�encodingr
)r�add_argument�
parse_argsr!�output_filer�template_dirrrr�stdin�readrr�
SystemExitr�dictrr�openr�stdout)�argv�parser�optionsr!r*�lookup_dirsr �templater"�kw�renderedr
r
r�cmdlinesr��
��


�

�r9�__main__r#)�argparser�os.pathrrr�makor�mako.lookupr�
mako.templaterrrr9�__name__r
r
r
r�<module>s
G
�