Ñò žòœMc@s[dZddklZddklZddklZlZd„Zd„Zd„Z dS( s@gettext message extraction via Babel: http://babel.edgewall.org/iÿÿÿÿ(tStringIO(textract_python(tlexert parsetreeccsn|id|iddƒƒ}ti|iƒd|ƒiƒ}x(t|iƒ|||ƒ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((s:/usr/lib/python2.6/vendor-packages/mako/ext/babelplugin.pytextracts  c csg}t}xl|D]d}d }|o+t|tiƒo|iiƒ oqnt|tiƒo|iiƒ}|o |i t |i |ƒƒqnxA|D]9} |i | ƒo#t }|i t |i |ƒƒq¡q¡Wqnt|tiƒo|ii} |i}n[t|tiƒo|ii} |i}n/t|tiƒo|ii} n t|tiƒoZdig} |iiƒD]\} } | d| | fq~ ƒ}d|} |i}nŸt|tiƒo*|iog}t}qn|i} nbt|tiƒog}t}|ii} n3t|tiƒo|ii} ng}t}q|o&|dd|i djo g}n&g}|D]}||dq£~}t| tƒo| iddƒ} nt| ƒ} xIt | |||ƒD]2\}}}}|i |d||||fVqWg}t}|o)x&t!||||ƒD] }|VqdWqqWd 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_decltcodetnodestCallTagtPageTagt body_decltCallNamespaceTagtjoint attributest iteritemst ControlLinetisendtCodet ExpressiontunicodetencodeRRR (R%RRRttranslator_commentstin_translator_commentstnodet child_nodestvaluet comment_tagR$t_[1]tkeytvaltattribst_[2]tcommentRtfuncnametmessagestpython_translator_commentsR((s:/usr/lib/python2.6/vendor-packages/mako/ext/babelplugin.pyR "s†      6     % cCs;g}t|iƒƒD]\}}||||fq~S(svReturn the multiline comment at lineno split into a list of comment line numbers and the accompanying comment line(t enumeratet splitlines(RR>R9tindextline((s:/usr/lib/python2.6/vendor-packages/mako/ext/babelplugin.pyR}sN( t__doc__Rtbabel.messages.extractRtmakoRRRR R(((s:/usr/lib/python2.6/vendor-packages/mako/ext/babelplugin.pyts   [