o
    ‹åg�  ã                   @   sV   d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlmZ G dd„ deeƒZdS )é    N)Ú	Extractor)Úget_extractor)ÚMessage)ÚMessageExtractorc                   @   s6   e Zd ZdZdZdgZdddœZddd	„Zd
d„ ZdS )ÚLinguaMakoExtractorzMako templatesFz.makozutf-8Ú )Úencodingzcomment-tagsNc                 c   sp   � || _ || _tdƒ| _|d u rt|dƒ}nt |¡}|�}|  |¡E d H  W d   ƒ d S 1 s1w   Y  d S )Nzx.pyÚr)ÚoptionsÚfilenamer   Úpython_extractorÚopenÚ
contextlibÚnullcontextÚprocess_file)Úselfr   r
   ÚfileobjÚctxÚfile_© r   úQ/var/www/html/flaskapp/venv/lib/python3.10/site-packages/mako/ext/linguaplugin.pyÚ__call__   s   €

"ÿzLinguaMakoExtractor.__call__c              
   c   s²   � |  ¡  ¡ }| d¡r'|dv s| d¡rd}n| d¡r#|dd … }|d7 }t |¡}|  | j| j||d ¡D ]}|rSt	|j
|j|j|jd	 ||jg ¡|j|jƒ}|V  q8d S )
Nú:)ztry:zelse:Úexceptr   Úelifé   Úpassé   ú )ÚgetvalueÚstripÚendswithÚ
startswithÚioÚStringIOr   r   r
   r   ÚmsgctxtÚmsgidÚmsgid_pluralÚflagsÚjoinÚcommentÚtcommentÚlocation)r   ÚcodeÚcode_linenoÚtranslator_stringsÚsourceÚmsgr   r   r   Úprocess_python#   s0   €


ÿù	óz"LinguaMakoExtractor.process_python)N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	use_bytesÚ
extensionsÚdefault_configr   r2   r   r   r   r   r      s    

r   )	r   r#   Úlingua.extractorsr   r   r   Úmako.ext.extractr   r   r   r   r   r   Ú<module>   s   