HEX
Server: LiteSpeed
System: Linux ws4.angoweb.net 5.14.0-611.13.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 11 04:57:59 EST 2025 x86_64
User: tswangoe (2287)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/mako/ext/__pycache__/extract.cpython-37.pyc
B

��m�0{��@s@ddlZddlmZddlmZddlmZGdd�de�ZdS)�N)�compat)�lexer)�	parsetreec@s(eZdZdd�Zdd�Zedd��ZdS)�MessageExtractorccs>tj|��|jdd���}x|�|���D]
}|Vq,WdS)N�encoding)�input_encoding)rZLexer�read�config�parse�
extract_nodesZget_children)�self�fileobjZ
template_node�	extracted�r�A/opt/alt/python37/lib/python3.7/site-packages/mako/ext/extract.py�process_fileszMessageExtractor.process_fileccsfg}d}|jdpd}ttdt�d|jd���}�x,|D�]"}d}|r`t|tj�r`|j�	�s`q:t|tj
�r�|j�	�}|r�|�|�
|j|��q:x.|D]&}	|�|	�r�d}|�|�
|j|��q�Wq:t|tj�r�|jj}
|j}n�t|tj�r�|jj}
|j}n�t|tj��r|jj}
|j}n�t|tj��r0|jj}
ntt|tj��rL|j}
|j}nXt|tj��rp|j�rhd}q:|j}
n4t|tj��r�d}|jj}
nt|tj�r:|jj}
nq:|�r�|dd|jd	k�r�g}d
d�|D�}t|
tj��r�|
� |d�}
d}t�!t�"d
�|
�}
x(|�#|
|jd	|�D]}
|
Vd}�qW|�r:g}d}|r:x|�$|�D]}|V�qNWq:WdS)NFr�asciiz\s+zcomment-tagsT���r�cSsg|]}|d�qS)rr)�.0�commentrrr�
<listcomp>Zsz2MessageExtractor.extract_nodes.<locals>.<listcomp>�backslashreplace�
)%r	�list�filter�re�split�
isinstancer�Text�content�strip�Comment�text�extend�_split_comment�lineno�
startswithZDefTagZ
function_decl�code�nodesZBlockTagZ	body_declZCallTagZPageTagZCallNamespaceTagZ
expressionZControlLineZisendZCode�
ExpressionrZ	text_type�encodeZbyte_buffer�bZprocess_pythonr)rr)Ztranslator_commentsZin_translator_commentsrZcomment_tags�nodeZchild_nodes�valueZcomment_tagr(Ztranslator_stringsZused_translator_comments�messagerrrrrs�







zMessageExtractor.extract_nodescs�fdd�t|���D�S)zzReturn the multiline comment at lineno split into a list of
        comment line numbers and the accompanying comment linecsg|]\}}�||f�qSrr)r�index�line)r&rrr{sz3MessageExtractor._split_comment.<locals>.<listcomp>)�	enumerate�
splitlines)r&rr)r&rr%vs
zMessageExtractor._split_commentN)�__name__�
__module__�__qualname__rr�staticmethodr%rrrrrs`r)r�makorrr�objectrrrrr�<module>s