/opt/alt/python27/lib/python2.7/site-packages/jinja2
NameSizeModeActions
testsuite/-0755rm
bccache.py123340644editdlrm
bccache.pyc145570644editdlrm
bccache.pyo146050644editdlrm
compiler.py617850644editdlrm
compiler.pyc560400644editdlrm
compiler.pyo565520644editdlrm
constants.py16260644editdlrm
constants.pyc17070644editdlrm
constants.pyo17070644editdlrm
debug.py109800644editdlrm
debug.pyc110910644editdlrm
debug.pyo110190644editdlrm
defaults.py10680644editdlrm
defaults.pyc16700644editdlrm
defaults.pyo16780644editdlrm
environment.py472440644editdlrm
environment.pyc470130644editdlrm
environment.pyo468190644editdlrm
exceptions.py44280644editdlrm
exceptions.pyc65210644editdlrm
exceptions.pyo65510644editdlrm
ext.py250780644editdlrm
ext.pyc248010644editdlrm
ext.pyo247340644editdlrm
filters.py298360644editdlrm
filters.pyc347800644editdlrm
filters.pyo349660644editdlrm
lexer.py283930644editdlrm
lexer.pyc231650644editdlrm
lexer.pyo232260644editdlrm
loaders.py170360644editdlrm
loaders.pyc194990644editdlrm
loaders.pyo195830644editdlrm
meta.py41900644editdlrm
meta.pyc41220644editdlrm
meta.pyo41220644editdlrm
nodes.py288750644editdlrm
nodes.pyc436530644editdlrm
nodes.pyo438390644editdlrm
optimizer.py23020644editdlrm
optimizer.pyc29290644editdlrm
optimizer.pyo29390644editdlrm
parser.py351860644editdlrm
parser.pyc319130644editdlrm
parser.pyo323340644editdlrm
runtime.py195580644editdlrm
runtime.pyc237850644editdlrm
runtime.pyo239840644editdlrm
sandbox.py134450644editdlrm
sandbox.pyc122710644editdlrm
sandbox.pyo122710644editdlrm
tests.py34440644editdlrm
tests.pyc52570644editdlrm
tests.pyo52590644editdlrm
utils.py161650644editdlrm
utils.pyc201650644editdlrm
utils.pyo203070644editdlrm
visitor.py33160644editdlrm
visitor.pyc39160644editdlrm
visitor.pyo39380644editdlrm
_compat.py40420644editdlrm
_compat.pyc64210644editdlrm
_compat.pyo64310644editdlrm
_stringdefs.py4042910644editdlrm
_stringdefs.pyc2086050644editdlrm
_stringdefs.pyo2086050644editdlrm
__init__.py22700644editdlrm
__init__.pyc24450644editdlrm
__init__.pyo24450644editdlrm
Edit: /opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyo (23226B)
Rc@sdZddkZddklZddklZddklZddkl Z ddk l Z l Z l Z lZlZe dZeid eiZeid eiZeid Zyed d dWn"ej oeidZn1XddklZeideieifZeidZeidZedZedZ edZ!edZ"edZ#edZ$edZ%edZ&edZ'edZ(edZ)edZ*ed Z+ed!Z,ed"Z-ed#Z.ed$Z/ed%Z0ed&Z1ed'Z2ed(Z3ed)Z4ed*Z5ed+Z6ed,Z7ed-Z8ed.Z9ed/Z:ed0Z;ed1Z<ed2Z=ed3Z>ed4Z?ed5Z@ed6ZAed7ZBed8ZCed9ZDed:ZEed;ZFed<ZGed=ZHed>ZIed?ZJed@ZKedAZLedBZMedCZNedDZOhedE6e7dF6e#dG6e&dH6e/dI6e.dJ6e2dK6e8dL6e*dM6e4dN6e+dO6e5dP6e)dQ6e3dR6e%dS6e0dT6e'dU6e(dV6e,dW6e-dX6e dY6e$dZ6e!d[6e1d\6e"d]6e6d^6ZPeQgZRe ePD]\ZSZTeReTeSfqa[RZUeid_d\iVd`eWePdadbDZXeYeEeGeFe9e9eJeKeLgZZeYe9eMeGeLgZ[dcZ\ddZ]deZ^dfZ_dgZ`dheafdiYZbdjecfdkYZde dleafdmYZee dneafdoYZfdpZgdqeafdrYZhdS(ss jinja2.lexer ~~~~~~~~~~~~ This module implements a Jinja / Python combination lexer. The `Lexer` class provided by this module is used to do some preprocessing for Jinja. On the one hand it filters out invalid operators like the bitshift operators we don't allow in templates. On the other hand it separates template code and python code in expressions. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. iN(t itemgetter(tdeque(tTemplateSyntaxError(tLRUCache(tnextt iteritemstimplements_iteratort text_typetinterni2s\s+s7('([^'\\]*(?:\\.[^'\\]*)*)'|"([^"\\]*(?:\\.[^"\\]*)*)")s\d+sföös tevals\b[a-zA-Z_][a-zA-Z0-9_]*\b(t _stringdefss [%s][%s]*s(?s>=ts tkeycCs t| S((tlen(RS((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pytscCsz|tjo t|Sh dt6dt6dt6dt6dt6dt6dt6dt6dt 6d t 6d t 6d t 6i ||S( Nsbegin of commentsend of commentR3sbegin of statement blocksend of statement blocksbegin of print statementsend of print statementsbegin of line statementsend of line statementstemplate data / textsend of template(treverse_operatorstTOKEN_COMMENT_BEGINtTOKEN_COMMENT_ENDt TOKEN_COMMENTtTOKEN_LINECOMMENTtTOKEN_BLOCK_BEGINtTOKEN_BLOCK_ENDtTOKEN_VARIABLE_BEGINtTOKEN_VARIABLE_ENDtTOKEN_LINESTATEMENT_BEGINtTOKEN_LINESTATEMENT_ENDt TOKEN_DATAt TOKEN_EOFtget(t token_type((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyt_describe_token_types    cCs%|idjo|iSt|iS(s#Returns a description of the token.R((ttypetvalueRf(ttoken((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pytdescribe_tokenscCsKd|jo.|idd\}}|djo|Sn|}t|S(s0Like `describe_token` but for token expressions.RLiR((tsplitRf(texprRgRh((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pytdescribe_token_exprs    cCstti|S(ssCount the number of newline characters in the string. This is useful for extensions that filter a stream. (RUt newline_retfindall(Rh((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pytcount_newlinesscCsti}t|id||ift|id||ift|id||ifg}|id j o0|it|idd||ifn|i d j o0|it|i dd||i fng}t |dt D]}||d q~S( sACompiles all the rules from the environment into a list of rules.R3tblocktvariablet linestatements ^[ \t\v]*R8s(?:^|(?<=\S))[^\S\r\n]*treverseiN( RPRQRUtcomment_start_stringtblock_start_stringtvariable_start_stringtline_statement_prefixtNonetappendtline_comment_prefixtsortedtTrue(t environmenttetrulest_[1]RS((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyt compile_ruless tFailurecBs#eZdZedZdZRS(sjClass that raises a `TemplateSyntaxError` if called. Used by the `Lexer` to specify known errors. cCs||_||_dS(N(tmessaget error_class(tselfRtcls((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyt__init__s cCs|i|i||dS(N(RR(Rtlinenotfilename((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyt__call__s(t__name__t __module__t__doc__RRR(((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyRs tTokencBs`eZdZdZdedD\ZZZdZdZ dZ dZ dZ RS( s Token class.ccs%x|]}tt|VqWdS(N(tpropertyR(RRRS((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pys s icCs%ti||tt||fS(N(ttuplet__new__Rtstr(RRRgRh((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyRscCs;|itjo t|iS|idjo|iS|iS(NR((RgRWRh(R((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyt__str__s  cCsI|i|jotSd|jo#|idd|i|igjStS(sTest a token against a token expression. This can either be a token type or ``'token_type:token_value'``. This can only test against string values and types. RLi(RgR}RkRhtFalse(RRl((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyttests  #cGs*x#|D]}|i|otSqWtS(s(Test against multiple token expressions.(RR}R(RtiterableRl((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyttest_anys  cCsd|i|i|ifS(NsToken(%r, %r, %r)(RRgRh(R((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyt__repr__s(( RRRt __slots__trangeRRgRhRRRRR(((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyRs   tTokenStreamIteratorcBs)eZdZdZdZdZRS(s`The iterator for tokenstreams. Iterate over the stream until the eof token is reached. cCs ||_dS(N(tstream(RR((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyRscCs|S(N((R((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyt__iter__scCsG|ii}|itjo|iitnt|i|S(N(RtcurrentRgRctcloset StopIterationR(RRi((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyt__next__s     (RRRRRR(((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyR s  t TokenStreamcBseZdZdZdZdZeZedddZdZ dZ d d Z d Z d Z d ZdZdZRS(sA token stream is an iterable that yields :class:`Token`\s. The parser however does not iterate over it but calls :meth:`next` to go one token ahead. The current active token is stored as :attr:`current`. cCsYt||_t|_||_||_t|_tdt d|_ t |dS(Nit( titert_iterRt_pushedR(RRtclosedRt TOKEN_INITIALRR(Rt generatorR(R((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyR(s    cCs t|S(N(R(R((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyR1scCs t|ip|iitj S(N(tboolRRRgRc(R((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyt__bool__4scCs| S(((RS((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyRV8stdocs Are we at the end of the stream?cCs|ii|dS(s Push a token back to the stream.N(RRz(RRi((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pytpush:scCs/t|}|i}|i|||_|S(sLook at the next token.(RRR(Rt old_tokentresult((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pytlook>s     icCs%xt|D]}t|q WdS(sGot n tokens ahead.N(RR(RtnRS((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pytskipFs cCs"|ii|o t|SdS(sqPerform the token test and return the token if it matched. Otherwise the return value is `None`. N(RRR(RRl((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pytnext_ifKscCs|i|dj S(s8Like :meth:`next_if` but only returns `True` or `False`.N(RRy(RRl((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pytskip_ifRscCsz|i}|io|ii|_nN|iitj o:yt|i|_Wqvtj o|iqvXn|S(s)Go one token ahead and return the old one( RRtpopleftRgRcRRRR(Rtrv((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyRVs  cCs1t|iitd|_d|_t|_dS(sClose the stream.RN(RRRRcRyRR}R(R((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyRbs cCs|ii|pt|}|iitjo)td||ii|i|intd|t |if|ii|i|inz |iSWdt |XdS(s}Expect a given token type and return it. This accepts the same argument as :meth:`jinja2.lexer.Token.test`. s(unexpected end of template, expected %r.sexpected token %r, got %rN( RRRmRgRcRRR(RRjR(RRl((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pytexpecths    (RRRRRRt __nonzero__RteosRRRRRRRR(((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyR!s        c Cs|i|i|i|i|i|i|i|i|i|i |i |i f }t i |}|djot|}|t |(?:\s*%s\-|%s)\s*raw\s*(?:\-%s\s*|%s))s(?P<%s_begin>\s*%s\-|%s)s#bygroups.+troots(.*?)((?:\-%s\s*|%s)%s)s#pops(.)sMissing end of comment tags(?:\-%s\s*|%s)%ss \-%s\s*|%ss1(.*?)((?:\s*%s\-|%s)\s*endraw\s*(?:\-%s\s*|%s%s))sMissing end of raw directives \s*(\n|$)s(.*?)()(?=\n|$)(/RPRQt whitespace_retTOKEN_WHITESPACERytfloat_ret TOKEN_FLOATt integer_ret TOKEN_INTEGERtname_ret TOKEN_NAMEt string_ret TOKEN_STRINGt operator_retTOKEN_OPERATORRRRRvtmatchRutgroupRwRRtjoinRRdRbRRZRYRRXR]R\RR_R^t TOKEN_RAW_ENDtTOKEN_RAW_BEGINRaR`R[tTOKEN_LINECOMMENT_ENDtTOKEN_LINECOMMENT_BEGINR(RR~tcRt tag_rulestroot_tag_rulestblock_suffix_ret prefix_ret no_lstrip_ret block_difftmt comment_difftno_variable_ret lstrip_retblock_prefix_retcomment_prefix_reRRtr((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyRs          ++'        >   "          " cCsti|i|S(s@Called for strings and template data to normalize it to unicode.(RnR#R(RRh((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyt_normalize_newlinesscCs7|i||||}t|i|||||S(sCCalls tokeniter + tokenize and wraps it in a token stream. (t tokeniterRtwrap(RtsourceR(RtstateR((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyttokenizesc csx|D]\}}}|tjoqn|djo d}n|djo d}np|djoqn\|djo|i|}n<|djo |}n%|d jot|}n|d joy/|i|d d !id did}WnItj o=}t|idd i}t||||nXyt|}Wqt j oqXnV|djot |}n9|djot |}n|djot |}nt |||VqWdS(sThis is called with the stream as returned by `tokenize` and wraps every token in a :class:`Token` and converts the value. R4R+R5R,R/R0R9tkeywordR(R)iitasciitbackslashreplacesunicode-escapeRLR'R&R*N(R/R0(tignored_tokensRRtencodetdecodet ExceptionRktstripRt UnicodeErrortintR&t operatorsR( RRR(RRRiRhRtmsg((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyR$sF                 c cst|}|i}|io>|o7x4dD](}|i|o|idPq0q0Wndi|}d}d}dg} |dj o"|djo| i|dnd}|i| d } t|} g} xx| D]i\} }}| i ||}|djoqn| o|djoqnt |t ox%t |D]\}}|i tjo|||qS|d jojxt|iD]?\}}|dj o&|||fV||id7}PqqWtd| qS|i|d}|p |tjo|||fVn||id7}qSWn"|i}|djo|djo| idq5|djo| idq5|djo| idq5|djod| ptd||||n| i}||jo#td||f|||q1q5n|p |tjo|||fVn||id7}|i}|dj o|djo| inq|d joVx`t|iD]+\}}|dj o| i|PqqWtd| n| i||i| d } n"||jotd| n|}PqW|| jodStd|||f|||qdS( sThis method tokenizes the text and returns the tokens in a generator. Use this method if you just want to tokenize a template. s s s RiiRt_beginiR.R,R5s#bygroups?%r wanted to resolve the token dynamically but no group matchedR*RFRGRDRERBRCsunexpected '%s'sunexpected '%s', expected '%s's#popsC%r wanted to resolve the new state dynamically but no group matcheds,%r yielded empty string without stack changeNsunexpected char %r at %d(s s s (R.s block_endslinestatement_end(RGRERC(Rt splitlinesRtendswithRzRRyRRURt isinstanceRt enumeratet __class__RRt groupdicttcountt RuntimeErrorRtignore_if_emptyRtpoptend(RRR(RRtlinestnewlinetposRtstackt statetokenst source_lengthtbalancing_stacktregexttokenst new_stateRtidxRiRTRhR9t expected_optpos2((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyRQs                                   N( RRRRRRyRRR(((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyRs  -(iRRPR*Rt collectionsRtjinja2.exceptionsRt jinja2.utilsRtjinja2._compatRRRRRRRtURRRRt SyntaxErrorRtjinja2R t xid_startt xid_continueRRnt TOKEN_ADDt TOKEN_ASSIGNt TOKEN_COLONt TOKEN_COMMAt TOKEN_DIVt TOKEN_DOTtTOKEN_EQtTOKEN_FLOORDIVtTOKEN_GTt TOKEN_GTEQt TOKEN_LBRACEtTOKEN_LBRACKETt TOKEN_LPARENtTOKEN_LTt TOKEN_LTEQt TOKEN_MODt TOKEN_MULtTOKEN_NEt TOKEN_PIPEt TOKEN_POWt TOKEN_RBRACEtTOKEN_RBRACKETt TOKEN_RPARENtTOKEN_SEMICOLONt TOKEN_SUBt TOKEN_TILDERRRRRRR\R]R^R_RRRXRYRZR`RaRRR[RbRRcRtdictRtktvRWRR|Rt frozensetRRRfRjRmRpRtobjectRRRRRRR(((s=/opt/alt/python27/lib/python2.7/site-packages/jinja2/lexer.pyts (                                                     9        +[