/usr/lib64/python2.6/site-packages/jinja2
NameSizeModeActions
bccache.py112940644editdlrm
bccache.pyc134770644editdlrm
bccache.pyo134770644editdlrm
compiler.py559230644editdlrm
compiler.pyc509150644editdlrm
compiler.pyo508450644editdlrm
constants.py62290644editdlrm
constants.pyc76970644editdlrm
constants.pyo76970644editdlrm
debug.py99270644editdlrm
debug.pyc101660644editdlrm
debug.pyo100940644editdlrm
defaults.py10500644editdlrm
defaults.pyc16140644editdlrm
defaults.pyo16140644editdlrm
environment.py346510644editdlrm
environment.pyc345220644editdlrm
environment.pyo341030644editdlrm
exceptions.py30730644editdlrm
exceptions.pyc47210644editdlrm
exceptions.pyo47210644editdlrm
ext.py181070644editdlrm
ext.pyc176810644editdlrm
ext.pyo176140644editdlrm
filters.py218060644editdlrm
filters.pyc247740644editdlrm
filters.pyo247740644editdlrm
lexer.py246640644editdlrm
lexer.pyc205660644editdlrm
lexer.pyo203970644editdlrm
loaders.py115070644editdlrm
loaders.pyc132180644editdlrm
loaders.pyo132180644editdlrm
meta.py28460644editdlrm
meta.pyc36670644editdlrm
meta.pyo36670644editdlrm
nodes.py234640644editdlrm
nodes.pyc381880644editdlrm
nodes.pyo376930644editdlrm
optimizer.py23020644editdlrm
optimizer.pyc28730644editdlrm
optimizer.pyo28730644editdlrm
parser.py306760644editdlrm
parser.pyc288520644editdlrm
parser.pyo288520644editdlrm
runtime.py176050644editdlrm
runtime.pyc214470644editdlrm
runtime.pyo214110644editdlrm
sandbox.py92600644editdlrm
sandbox.pyc97180644editdlrm
sandbox.pyo97180644editdlrm
tests.py32660644editdlrm
tests.pyc49220644editdlrm
tests.pyo49220644editdlrm
utils.py248940644editdlrm
utils.pyc315080644editdlrm
utils.pyo315080644editdlrm
visitor.py33160644editdlrm
visitor.pyc38500644editdlrm
visitor.pyo38500644editdlrm
_ipysupport.py9490644editdlrm
_ipysupport.pyc17760644editdlrm
_ipysupport.pyo17760644editdlrm
_speedups.so82320755editdlrm
_stringdefs.py4042560644editdlrm
_stringdefs.pyc2085250644editdlrm
_stringdefs.pyo2085250644editdlrm
__init__.py21950644editdlrm
__init__.pyc23960644editdlrm
__init__.pyo23960644editdlrm
Edit: /usr/lib64/python2.6/site-packages/jinja2/ext.pyc (17681B)
Ñò {ÉyJc @s?dZddklZddklZddkTddklZddkl Z l Z ddk l Z l Z ddklZlZlZlZdZd efd „ƒYZdefd„ƒYZed„ƒZdefd„ƒYZdefd„ƒYZdefd„ƒYZeed„Zd„ZeZeZ eZ!dS(s  jinja2.ext ~~~~~~~~~~ Jinja extensions allow to add custom tags similar to the way django custom tags work. By default two example extensions exist: an i18n and a cache extension. :copyright: (c) 2009 by the Jinja Team. :license: BSD. iÿÿÿÿ(tdeque(tnodes(t*(tget_spontaneous_environment(t Undefinedtconcat(tTemplateAssertionErrortTemplateSyntaxError(tcontextfunctiont import_stringtMarkuptnextt_tgettexttngettexttExtensionRegistrycBseZdZd„ZRS(s)Gives the extension an unique identifier.cCs3ti||||ƒ}|id|i|_|S(Nt.(ttypet__new__t __module__t__name__t identifier(tclstnametbasestdtrv((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyRs(RRt__doc__R(((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyRst ExtensioncBsqeZdZeZeƒZd„Zd„Zdd„Z d„Z d„Z dd„Z dddddd„ZRS( sgExtensions can be used to add extra functionality to the Jinja template system at the parser level. Custom extensions are bound to an environment but may not store environment specific data on `self`. The reason for this is that an extension can be bound to another environment (for overlays) by creating a copy and reassigning the `environment` attribute. As extensions are created by the environment they cannot accept any arguments for configuration. One may want to work around that by using a factory function, but that is not possible as extensions are identified by their import name. The correct way to configure the extension is storing the configuration values on the environment. Because this way the environment ends up acting as central configuration storage the attributes may clash which is why extensions have to ensure that the names they choose for configuration are not too generic. ``prefix`` for example is a terrible name, ``fragment_cache_prefix`` on the other hand is a good name as includes the name of the extension (fragment cache). cCs ||_dS(N(t environment(tselfR((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyt__init__<scCs2ti|iƒ}|ii|iƒ||_|S(s=Create a copy of this extension bound to another environment.(tobjectRt __class__t__dict__tupdateR(RRR((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pytbind?s cCs|S(sÁThis method is called before the actual lexing and can be used to preprocess the source. The `filename` is optional. The return value must be the preprocessed source. ((RtsourceRtfilename((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyt preprocessFscCs|S(s¹It's passed a :class:`~jinja2.lexer.TokenStream` that can be used to filter tokens returned. This method has to return an iterable of :class:`~jinja2.lexer.Token`\s, but it doesn't have to return a :class:`~jinja2.lexer.TokenStream`. In the `ext` folder of the Jinja2 source distribution there is a file called `inlinegettext.py` which implements a filter that utilizes this method. ((Rtstream((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyt filter_streamMs cCs tƒ‚dS(sIf any of the :attr:`tags` matched this method is called with the parser as first argument. The token the parser stream is pointing at is the name token that matched. This method has to return one or a list of multiple nodes. N(tNotImplementedError(Rtparser((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pytparseYscCsti|i|d|ƒS(sÈReturn an attribute node for the current extension. This is useful to pass constants on extensions to generated template code:: self.attr('_my_attribute', lineno=lineno) tlineno(RtExtensionAttributeR(RRR-((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pytattrascCs\|djo g}n|djo g}nti|i|d|ƒ||||d|ƒS(ssCall a method of the extension. This is a shortcut for :meth:`attr` + :class:`jinja2.nodes.Call`. R-N(tNoneRtCallR/(RRtargstkwargstdyn_argst dyn_kwargsR-((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyt call_methodis     N(RRRRt __metaclass__tsetttagsRR$R0R'R)R,R/R6(((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyR%s       cCs|idƒ|ƒS(NR (tresolve(tcontexttstring((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyt_gettext_aliasvstInternationalizationExtensioncBsheZdZedgƒZd„Zd„Zd„Zd„Ze d„Z d„Z d„Z d „Z RS( s.This extension adds gettext support to Jinja2.ttransc CsOti||ƒt|id<|id|id|id|id|iƒdS(NR tinstall_gettext_translationstinstall_null_translationstuninstall_gettext_translationstextract_translations( RRR=tglobalstextendt_installt _install_nullt _uninstallt_extract(RR((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyR†s     cCsxt|ddƒ}|djo |i}nt|ddƒ}|djo |i}n|iiid|d|ƒdS(Ntugettextt ungettextR R(tgetattrR0R RRRDR#(Rt translationsR R((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyRFs    cCs&|iiidd„dd„ƒdS(NR cSs|S(((tx((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyt›sRcSs"|djo |fp|fdS(ii((tstptn((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyROœs(RRDR#(R((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyRG™s cCs+x$dD]}|iii|dƒqWdS(NR R(sgettextsngettext(RRDtpopR0(RRMtkey((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyRHŸscCs3t|tƒo|ii|ƒ}nt||ƒS(N(t isinstancet basestringRR,textract_from_ast(RR%tgettext_functions((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyRI£sc CsÂt|iƒi}d}h}x |iiidjoò|o|iidƒn|iidƒoPn|iidƒ}|i|jo$|i d|i|idt ƒn|iiidjo(t|iƒ|i ƒ||i<}n!t i |idƒ||i<}|djo |}q!q!W|iidƒd}}t} tƒ} |i|tƒ\} } | o8| i| ƒ|djot i | d dƒ}qªn|iiid ƒoÆt} t|iƒ|iiidjoW|iidƒ}|i|jo$|i d |i|idt ƒn||i}n|iidƒ|i|tƒ\}}t|iƒ| i|ƒnt|iƒx5| D]-}||jot i |dƒ||{s    Y tExprStmtExtensioncBs&eZdZedgƒZd„ZRS(ssAdds a `do` tag to Jinja2 that works like the print statement just that it doesn't print the return value. tdocCs1tidt|iƒiƒ}|iƒ|_|S(NR-(RtExprStmtR R(R-t parse_tupleR}(RR+R}((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyR,Bs(RRRR8R9R,(((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyRŒ<stLoopControlExtensioncBs)eZdZeddgƒZd„ZRS(s/Adds break and continue to the template engine.tbreaktcontinuecCsFt|iƒ}|idjotid|iƒStid|iƒS(NR‘R-(R R(RcRtBreakR-tContinue(RR+ttoken((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyR,Ls(RRRR8R9R,(((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyRHsccs‰x‚|itiƒD]n}t|itiƒ p|ii|joqng}xX|iD]M}t|tiƒo't|i t ƒo|i |i ƒqZ|i dƒqZWx|i D]}|i dƒqµW|idj o|i dƒn|idj o|i dƒn|p(td„|Dƒƒ}|pqqjn.t|ƒdjo|d}n t|ƒ}|i|ii|fVqWdS(sExtract localizable strings from the given template node. Per default this function returns matches in babel style that means non string parameters as well as keyword arguments are returned as `None`. This allows Babel to figure out what you really meant if you are using gettext functions that allow keyword arguments for placeholder expansion. If you don't want that behavior set the `babel_style` parameter to `False` which causes only strings to be returned and parameters are always stored in tuples. As a consequence invalid gettext calls (calls without a single string parameter or string parameters after non-string parameters) are skipped. This example explains the behavior: >>> from jinja2 import Environment >>> env = Environment() >>> node = env.parse('{{ (_("foo"), _(), ngettext("foo", "bar", 42)) }}') >>> list(extract_from_ast(node)) [(1, '_', 'foo'), (1, '_', ()), (1, 'ngettext', ('foo', 'bar', None))] >>> list(extract_from_ast(node, babel_style=False)) [(1, '_', ('foo',)), (1, 'ngettext', ('foo', 'bar'))] For every string found this function yields a ``(lineno, function, message)`` tuple, where: * ``lineno`` is the number of the line on which the string was found, * ``function`` is the name of the ``gettext`` function used (if the string was extracted from embedded Python code), and * ``message`` is the string itself (a ``unicode`` object, or a tuple of ``unicode`` objects for functions with multiple string arguments). css*x#|]}|dj o |VqqWdS(N(R0(t.0RN((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pys ˆs iiN(tfind_allRR1RUR}RfRR2RoRcRVR‚R0R3R4R5ttupletlenR-(R}RXt babel_styletstringstarg((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyRWSs6     c csÍtƒ}xP|iddƒidƒD]3}|iƒ}|pq%n|it|ƒƒq%Wt|jo|itƒnt|idtƒ|idt ƒ|idt ƒ|idt ƒ|idt ƒ|id t ƒ|id ƒpt|id ƒptt|id tƒƒiƒdjtt|ƒttdtddtdƒ}|iƒi|iddƒƒ}y|i|ƒ}Wntj o } dSXx1t||ƒD] \} } } | | | gfVq¥WdS(sIBabel extraction method for Jinja 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. (Unused) :param options: a dictionary of additional options (optional) :return: an iterator over ``(lineno, funcname, message, comments)`` tuples. (comments will be empty currently) t extensionstt,tblock_start_stringtblock_end_stringtvariable_start_stringtvariable_end_stringtcomment_start_stringtcomment_end_stringtline_statement_prefixtline_comment_prefixt trim_blockst1tontyesttrueitencodingsutf-8N(R©RªR«R¬(R8tgettsplittstriptaddR R>RtBLOCK_START_STRINGtBLOCK_END_STRINGtVARIABLE_START_STRINGtVARIABLE_END_STRINGtCOMMENT_START_STRINGtCOMMENT_END_STRINGtLINE_STATEMENT_PREFIXtLINE_COMMENT_PREFIXtstrt TRIM_BLOCKStlowertNEWLINE_SEQUENCEt frozensetRiRR0RgtreadtdecodeR,RRW( tfileobjtkeywordst comment_tagstoptionsRt extensionRR%R}teR-tfunctmessage((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyt babel_extract“s<    !N(R sgettextsngettext("Rt collectionsRtjinja2Rtjinja2.defaultstjinja2.environmentRtjinja2.runtimeRRtjinja2.exceptionsRRt jinja2.utilsRR R R R‹RRR RR=R>RŒRRiRWRÉti18nRt loopcontrols(((s0/usr/lib64/python2.6/site-packages/jinja2/ext.pyt s( " QÁ   ? 4