관리-도구
편집 파일: linguaplugin.cpython-38.pyc
U +�e� � @ sV d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlmZ G dd� dee�ZdS )� N)� Extractor)� get_extractor)�Message)�MessageExtractorc @ s6 e Zd ZdZdZdgZddd�Zddd �Zd d� ZdS ) �LinguaMakoExtractorzMako templatesFz.makozutf-8� )�encodingzcomment-tagsNc c sX || _ || _td�| _|d kr*t|d�}n t�|�}|�}| �|�E d H W 5 Q R X d S )Nzx.py�r)�options�filenamer �python_extractor�open� contextlib�nullcontextZprocess_file)�selfr r �fileobj�ctx�file_� r �C/opt/hc_python/lib/python3.8/site-packages/mako/ext/linguaplugin.py�__call__ s zLinguaMakoExtractor.__call__c c s� |� � �� }|�d�rL|dks(|�d�r.d}n|�d�rD|dd � }|d7 }t�|�}| �| j| j||d �D ]<}|r�t |j |j|j|j d �||jg �|j|j�}|V qnd S ) N�:)ztry:zelse:�exceptr �elif� �pass� � )�getvalue�strip�endswith� startswith�io�StringIOr r r r Zmsgctxt�msgidZmsgid_plural�flags�join�commentZtcomment�location)r �codeZcode_linenoZtranslator_strings�source�msgr r r �process_python# s2 �� z"LinguaMakoExtractor.process_python)N) �__name__� __module__�__qualname__�__doc__� use_bytes� extensionsZdefault_configr r, r r r r r s r ) r r"