U  üe+ã@s8dZddlmZddlmZGdd„deƒZdd„ZdS) zEgettext message extraction via Babel: https://pypi.org/project/Babel/é)Úextract_python)ÚMessageExtractorcs,eZdZ‡fdd„Zdd„Zdd„Z‡ZS)ÚBabelMakoExtractorcs<||_||_d |¡| d| dd¡¡dœ|_tƒ ¡dS)Nú Zinput_encodingÚencoding)ú comment-tagsr)ÚkeywordsÚoptionsÚjoinÚgetÚconfigÚsuperÚ__init__)ÚselfrÚ comment_tagsr ©Ú __class__©úB/opt/hc_python/lib/python3.8/site-packages/mako/ext/babelplugin.pyrs ÿþzBabelMakoExtractor.__init__cCs | |¡S)N)Z process_file)rÚfileobjrrrÚ__call__szBabelMakoExtractor.__call__c csH|jd}t||j||jƒD]&\}}}}||d||||fVqdS)Nré)r rrr ) rÚcodeZ code_linenoZtranslator_stringsrÚlinenoÚfuncnameÚmessagesZpython_translator_commentsrrrÚprocess_pythons û üz!BabelMakoExtractor.process_python)Ú__name__Ú __module__Ú __qualname__rrrÚ __classcell__rrrrr s rccst|||ƒ}||ƒEdHdS)aExtract 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)rrrr Z extractorrrrÚextract,s r!N)Ú__doc__Zbabel.messages.extractrZmako.ext.extractrrr!rrrrÚs