관리-도구
편집 파일: linguaplugin.cpython-37.pyc
B �C]� � @ sZ d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ G dd� dee�Z dS ) � N)� Extractor)� get_extractor)�Message)�compat)�MessageExtractorc @ s2 e Zd ZdZdgZddd�Zddd�Zd d � ZdS )�LinguaMakoExtractorzMako templatesz.makozutf-8� )�encodingzcomment-tagsNc C s2 || _ || _td�| _|d kr(t|d�}| �|�S )Nzx.py�rb)�options�filenamer �python_extractor�openZprocess_file)�selfr r �fileobj� r �F/opt/alt/python37/lib/python3.7/site-packages/mako/ext/linguaplugin.py�__call__ s zLinguaMakoExtractor.__call__c c s� |� � �� }|�t�d��rz|t�d�t�d�fksD|�t�d��rPt�d�}n|�t�d��rl|dd � }|t�d�7 }t�|�}x^| �| j | j ||d �D ]B}|r�t|j|j |j|jt�d ��||jg �|j|j�}|V q�W d S )N�:ztry:zelse:�exceptr �elif� �pass� � )�getvalue�strip�endswithr �b� startswith�io�BytesIOr r r r Zmsgctxt�msgidZmsgid_plural�flags�u�join�commentZtcomment�location)r �codeZcode_linenoZtranslator_strings�source�msgr r r �process_python s. z"LinguaMakoExtractor.process_python)N)�__name__� __module__�__qualname__�__doc__� extensionsZdefault_configr r+ r r r r r s r ) r Zlingua.extractorsr r r �makor Zmako.ext.extractr r r r r r �<module> s