%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/mako/ext/
Upload File :
Create Path :
Current File : //proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/mako/ext/babelplugin.pyc

�
�ǚPc@sadZddlmZddlmZddlmZmZmZd�Zd�Z	d�Z
dS(	s@gettext message extraction via Babel: http://babel.edgewall.org/i����(tStringIO(textract_python(tlexert	parsetreetutilccsn|jd|jdd��}tj|j�d|�j�}x(t|j�|||�D]}|Vq[WdS(sExtract 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``
    tinput_encodingtencodingN(tgettNoneRtLexertreadtparset
extract_nodestget_children(tfileobjtkeywordstcomment_tagstoptionsRt
template_nodet	extracted((sE/opt/alt/python27/lib/python2.7/site-packages/mako/ext/babelplugin.pytextractsccs�g}t}xo|D]g}d	}|rMt|tj�rM|jj�rMqnt|tj�r�|jj�}|r�|j	t
|j|��qnx?|D]7}	|j|	�r�t
}|j	t
|j|��q�q�Wqnt|tj�r|jj}
|j}nnt|tj�r/|jj}
|j}nDt|tj�rY|jj}
|j}nt|tj�rz|jj}
n�t|tj�r�djg|jj�D]\}}d||f^q��}
d|
}
|j}n�t|tj�r|jr
g}t}qn|j}
n]t|tj�rCg}t}|jj}
n0t|tj�rd|jj}
ng}t}q|r�|dd|jdkr�g}ng|D]}|d^q�}tjr�t|
t �r�|
j!dd�}
nt"|
�}
xIt#|
|||�D]2\}}}}|j|d||||fVq
Wg}t}|rx%t$||||�D]}|VqhWqqWd	S(
s'Extract messages from Mako's lexer node objects

    :param nodes: an iterable of Mako parsetree.Node objects to extract 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``
    s, s%s=%ss{%s}i����iitasciitbackslashreplaceN(%tFalseRt
isinstanceRtTexttcontenttstriptCommentttexttextendt_split_commenttlinenot
startswithtTruetDefTagt
function_decltcodetnodestBlockTagt	body_decltCallTagtPageTagtCallNamespaceTagtjoint
attributest	iteritemstControlLinetisendtCodet
ExpressionRtpy3ktunicodetencodeRRR(R&RRRttranslator_commentstin_translator_commentstnodetchild_nodestvaluetcomment_tagR%tkeytvaltattribstcommentR tfuncnametmessagestpython_translator_commentsR((sE/opt/alt/python27/lib/python2.7/site-packages/mako/ext/babelplugin.pyR"s�

	2
		%
cCs3gt|j��D]\}}|||f^qS(svReturn the multiline comment at lineno split into a list of comment line
    numbers and the accompanying comment line(t	enumeratet
splitlines(R R?tindextline((sE/opt/alt/python27/lib/python2.7/site-packages/mako/ext/babelplugin.pyR�sN(t__doc__Rtbabel.messages.extractRtmakoRRRRRR(((sE/opt/alt/python27/lib/python2.7/site-packages/mako/ext/babelplugin.pyt<module>s		^

Zerion Mini Shell 1.0