U  e@sVddlZddlZddlmZddlmZddlmZddlmZGdddeeZdS)N) Extractor) get_extractor)Message)MessageExtractorc@s6eZdZdZdZdgZdddZd dd Zd d ZdS) LinguaMakoExtractorzMako templatesFz.makozutf-8)encodingz comment-tagsNc csX||_||_td|_|dkr*t|d}n t|}|}||EdHW5QRXdS)Nzx.pyr)optionsfilenamerpython_extractoropen contextlib nullcontextZ process_file)selfr r fileobjctxfile_rC/opt/hc_python/lib/python3.8/site-packages/mako/ext/linguaplugin.py__call__s   zLinguaMakoExtractor.__call__c cs|}|drL|dks(|dr.d}n|drD|dd}|d7}t|}||j|j||dD]<}|rt |j |j |j |j d ||jg|j|j}|VqndS) N:)ztry:zelse:exceptrelifpass )getvaluestripendswith startswithioStringIOr r r rZmsgctxtmsgidZ msgid_pluralflagsjoincommentZtcommentlocation)rcodeZ code_linenoZtranslator_stringssourcemsgrrrprocess_python#s2      z"LinguaMakoExtractor.process_python)N) __name__ __module__ __qualname____doc__ use_bytes extensionsZdefault_configrr,rrrrrs   r) rr"Zlingua.extractorsrrrZmako.ext.extractrrrrrrs