| Server IP : 93.115.150.27 / Your IP : 216.73.216.221 Web Server : LiteSpeed System : Linux host2.azar.host 4.18.0-553.80.1.lve.el8.x86_64 #1 SMP Wed Oct 22 19:29:36 UTC 2025 x86_64 User : dorfakkh ( 1797) PHP Version : 8.1.34 Disable Function : show_source, system, passthru, exec, popen, proc_open, mail MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/python37/lib/python3.7/site-packages/mako/ext/__pycache__/ |
Upload File : |
B
�C]Z � @ s8 d Z ddlmZ ddlmZ G dd� de�Zdd� ZdS ) z@gettext message extraction via Babel: http://babel.edgewall.org/� )�extract_python)�MessageExtractorc s, e Zd Z� fdd�Zdd� Zdd� Z� ZS )�BabelMakoExtractorc s@ || _ || _d�|�|�d|�dd ��d�| _tt| ��� d S )N� Zinput_encoding�encoding)zcomment-tagsr )�keywords�options�join�get�config�superr �__init__)�selfr �comment_tagsr )� __class__� �E/opt/alt/python37/lib/python3.7/site-packages/mako/ext/babelplugin.pyr
s zBabelMakoExtractor.__init__c C s
| � |�S )N)Zprocess_file)r �fileobjr r r �__call__ s zBabelMakoExtractor.__call__c c sL | j d }x<t|| j|| j�D ]&\}}}}||d |||| fV qW d S )Nzcomment-tags� )r r r r ) r �codeZcode_linenoZtranslator_stringsr �lineno�funcname�messagesZpython_translator_commentsr r r �process_python s
z!BabelMakoExtractor.process_python)�__name__�
__module__�__qualname__r
r r �
__classcell__r r )r r r
s r c c s( t |||�}x|| �D ]
}|V qW dS )a Extract messages from Mako templates.
:param fileobj: the file-like object the messages should be extracted from
:param keywords: a list of keywords (i.e. function names) that should be
recognized as translation functions
:param comment_tags: a list of translator tags to search for and include
in the results
:param options: a dictionary of additional options (optional)
:return: an iterator over ``(lineno, funcname, message, comments)`` tuples
:rtype: ``iterator``
N)r )r r r r Z extractor�messager r r �extract, s r N)�__doc__Zbabel.messages.extractr Zmako.ext.extractr r r r r r r �<module> s