
    +h                     \    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ee      Zy)    N)	Extractor)get_extractor)Message)MessageExtractorc                   2    e Zd ZdZdZdgZdddZd
dZd	 Zy)LinguaMakoExtractorzMako templatesFz.makozutf-8 )encodingzcomment-tagsNc              #      K   || _         || _        t        d      | _        |t	        |d      }nt        j                  |      }|5 }| j                  |      E d {    d d d        y 7 # 1 sw Y   y xY ww)Nzx.pyr)optionsfilenamer   python_extractoropen
contextlibnullcontextprocess_file)selfr   r   fileobjctxfile_s         H/var/www/html/venv/lib/python3.12/site-packages/mako/ext/linguaplugin.py__call__zLinguaMakoExtractor.__call__   sx       -f 5?x%C((1C 	0E((///	0 	0/	0 	0s0   AA8A,A*A,!	A8*A,,A51A8c              #   :  K   |j                         j                         }|j                  d      r3|dv s|j                  d      rd}n|j                  d      r|dd  }|dz  }t	        j
                  |      }| j                  | j                  | j                  ||dz
        D ]r  }|rjt        |j                  |j                  |j                  |j                  d	j                  ||j                  gz         |j                   |j"                        }| t y w)
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msgs         r   process_pythonz"LinguaMakoExtractor.process_python#   s     &&(??3**f.?.?.I""6*fF{{6"((MM4<<{Q
 	C "KKII$$IIHH/3;;-?@LLLL I	s   DD)N)	__name__
__module____qualname____doc__	use_bytes
extensionsdefault_configr   r5        r   r   r      s%    IJ")2>N	0r>   r   )	r   r&   lingua.extractorsr   r   r   mako.ext.extractr   r   r=   r>   r   <module>rA      s(     	 ' + % -()%5 (r>   