HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/mako/ext/__pycache__/extract.cpython-37.opt-1.pyc
B

�C]�@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)�selfZfileobjZ
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�
isinstancerZTextZcontent�strip�Comment�text�extend�_split_comment�lineno�
startswithZDefTagZ
function_decl�code�nodesZBlockTagZ	body_declZCallTagZPageTagZCallNamespaceTagZ
expressionZControlLineZisendZCodeZ
ExpressionrZ	text_type�encodeZbyte_buffer�bZprocess_pythonr)rr&Ztranslator_commentsZin_translator_commentsrZcomment_tagsZnodeZchild_nodes�valueZcomment_tagr%Ztranslator_stringsZused_translator_comments�messager
rrrrs�







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)rZmakorrr�objectrrrrr�<module>s