
    tZh+                     <    d Z ddlmZ ddlmZ  G d de      Zd Zy)zEgettext message extraction via Babel: https://pypi.org/project/Babel/    )extract_python)MessageExtractorc                   *     e Zd Z fdZd Zd Z xZS )BabelMakoExtractorc                     || _         || _        dj                  |      |j                  d|j                  dd             d| _        t
        |           y )N input_encodingencoding)comment-tagsr
   )keywordsoptionsjoingetconfigsuper__init__)selfr   comment_tagsr   	__class__s       p/var/www/html/wine-match-dev/backend/winematch-backend/venv/lib/python3.12/site-packages/mako/ext/babelplugin.pyr   zBabelMakoExtractor.__init__   sO     HH\2 '++j$"?
 	    c                 $    | j                  |      S )N)process_file)r   fileobjs     r   __call__zBabelMakoExtractor.__call__   s      ))r   c              #      K   | j                   d   }t        || j                  || j                        D ]  \  }}}}||dz
  z   ||||z   f  y w)Nr      )r   r   r   r   )	r   codecode_linenotranslator_stringsr   linenofuncnamemessagespython_translator_commentss	            r   process_pythonz!BabelMakoExtractor.process_python   sn     {{>2 D$--t||L	 
& vz*"%??	 	s   AA)__name__
__module____qualname__r   r   r%   __classcell__)r   s   @r   r   r      s    	*r   r   c              #   J   K   t        |||      } ||       E d{    y7 w)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   	extractors        r   extractr,   ,   s$      #8\7CI!!!s   #!#N)__doc__babel.messages.extractr   mako.ext.extractr   r   r,    r   r   <module>r1      s#    L 1 -) >"r   