Pj D d Z ddlmZ ddlmZ G d de Zd ZdS )zEgettext message extraction via Babel: https://pypi.org/project/Babel/ )extract_python)MessageExtractorc * e Zd Z fdZd Zd Z xZS )BabelMakoExtractorc || _ || _ d | | d| dd d| _ t d S )N input_encodingencoding)comment-tagsr
)keywordsoptionsjoingetconfigsuper__init__)selfr comment_tagsr
__class__s f/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/mako/ext/babelplugin.pyr zBabelMakoExtractor.__init__ sp
HH\22 '++j$"?"?
c , | | S )N)process_file)r fileobjs r __call__zBabelMakoExtractor.__call__ s )))r c # K | j d }t || j || j D ]\ }}}}||dz
z ||||z fV d S )Nr )r r r r
) r codecode_linenotranslator_stringsr linenofuncnamemessagespython_translator_commentss r process_pythonz!BabelMakoExtractor.process_python s {>2 D$-t|
L
L
& vz*"%??
r )__name__
__module____qualname__r r r%
__classcell__)r s @r r r
sV * * *
r r c # N K t ||| } || E d{V dS )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, , sA #8\7CCIy!!!!!!!!!!!r N)__doc__babel.messages.extractr mako.ext.extractr r r, r r