lLc@sdZddkZddklZlZddklZlZddkZye Wn3e j o'ddk l Z ddk lZ nXddklZddklZdd klZdd klZd d d ddddgZdZeZy'defdYZdheUWn+ej o eZnej onX[dZ d efdYZ!d e!fdYZ"d e!fdYZ#eZ$defdYZ%defdYZ&defdYZ'de'fdYZ(de'fdYZ)d d!Z*dd dddd"Z,ei-i.Z/e/i0hed#6e&d6e d$d%d&d'd(gZ1d)efd*YZ2d+e2fd,YZ3d-e3fd.YZ4dS(/s4Support for "safe" evaluation of Python expressions.iN(tasttparse(tExpressionCodeGeneratortModuleCodeGenerator(t ImmutableSet(tSet(tdedent(tMarkup(tTemplateRuntimeError(tflattentCodet ExpressiontSuitet LenientLookupt StrictLookupt UndefinedtUndefinedErrorsrestructuredtext ent _FakeMappingcBseZdZZRS(cGsdS(N(tNone(ta((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt's(t__name__t __module__t __getitem__t __setitem__(((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyR&ssfrom sys import *c Cst|dddg}t|do |i}n9g}|iD]!}|idp ||qCqC~}|ig}|D]}||t||fq~~dS(shThis function is used as helper if a Python version with a broken star-import opcode is in use. t__all__t_N(t __import__RthasattrRt__dict__t startswithtupdatetgetattr(tmappingtmodnametmoduletmemberst_[1]txt_[2]tname((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt_star_import_patch/s  8cBskeZdZddddgZdddddZdZd Zd Zd Z d Z d Z RS(s=Abstract base class for the `Expression` and `Suite` classes.tsourcetcodeRt_globalsitstrictc Cst|to"||_t|d|i}n`t|tiptd|d|_|idjoti|}nti d |}||_t ||id|id|d|d||_ |d jo t }n-t|toht d6td 6|}n|i|_d S( sCreate the code object, either from a string, or from an AST node. :param source: either a string containing the source code, or an AST node :param filename: the (preferably absolute) name of the file containing the code :param lineno: the number of the line on which the code was found :param lookup: the lookup class that defines how variables are looked up in the context; can be either "strict" (the default), "lenient", or a custom lookup class :param xform: the AST transformer that should be applied to the code; if `None`, the appropriate transformation is chosen depending on the mode tmodes'Expected string or AST node, but got %rt?tevaltfilenametlinenotxformtlenientR-N(t isinstancet basestringR*t_parseR.RtNodetAssertionErrorR tModuleRt_compileR+R RtglobalsR,(tselfR*R1R2tlookupR3tnode((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt__init__?s"      c Csh|id6|id6|iid6}|i}|i|i|i|i|i |i |i |i |i |i|iddf |d<|S(NR*RR>R+(((R*RR,tim_selfR+t co_nlocalst co_stacksizetco_flagstco_codet co_conststco_namest co_varnamest co_filenametco_nametco_firstlinenot co_lnotab(R=tstatetc((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt __getstate__ds "cCsG|d|_|d|_tid|d|_|di|_dS(NR*RiR+R>(R*RtnewR+R<R,(R=RM((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt __setstate__ms  cCs)t|t|jo|i|ijS(N(ttypeR+(R=tother((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt__eq__sscCs t|iS(N(thashR+(R=((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt__hash__vscCs ||j S(N((R=RS((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt__ne__yscCsd|ii|ifS(Ns%s(%r)(t __class__RR*(R=((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt__repr__|sN( RRt__doc__t __slots__RR@RORQRTRVRWRY(((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyR ;s  $    cBs#eZdZgZdZdZRS(sEvaluates Python expressions used in templates. >>> data = dict(test='Foo', items=[1, 2, 3], dict={'some': 'thing'}) >>> Expression('test').evaluate(data) 'Foo' >>> Expression('items[0]').evaluate(data) 1 >>> Expression('items[-1]').evaluate(data) 3 >>> Expression('dict["some"]').evaluate(data) 'thing' Similar to e.g. Javascript, expressions in templates can use the dot notation for attribute access to access items in mappings: >>> Expression('dict.some').evaluate(data) 'thing' This also works the other way around: item access can be used to access any object attribute: >>> class MyClass(object): ... myattr = 'Bar' >>> data = dict(mine=MyClass(), key='myattr') >>> Expression('mine.myattr').evaluate(data) 'Bar' >>> Expression('mine["myattr"]').evaluate(data) 'Bar' >>> Expression('mine[key]').evaluate(data) 'Bar' All of the standard Python operators are available to template expressions. Built-in functions such as ``len()`` are also available in template expressions: >>> data = dict(items=[1, 2, 3]) >>> Expression('len(items)').evaluate(data) 3 R0cCs/d}|i|}t|i|h|d6S(sEvaluate the expression against the given data dictionary. :param data: a mapping containing the data to evaluate against :return: the result of the evaluation tbefore_and_thist__data__(R,R0R+(R=tdatat__traceback_hide__R,((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pytevaluates(RRRZR[R.R`(((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyR s(cBs#eZdZgZdZdZRS(sExecutes Python statements used in templates. >>> data = dict(test='Foo', items=[1, 2, 3], dict={'some': 'thing'}) >>> Suite("foo = dict['some']").execute(data) >>> data['foo'] 'thing' texeccBs&d}|i|}|i||UdS(sExecute the suite in the given data dictionary. :param data: a mapping containing the data to execute in R\N(R,R+(R=R^R_R,((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pytexecutes(RRRZR[R.Rb(((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyR scBseZdZedZRS(sException thrown when a template expression attempts to access a variable not defined in the context. :see: `LenientLookup`, `StrictLookup` cCsE|tj odt||f}n d|}ti||dS(Ns%s has no member named "%s"s"%s" not defined(t UNDEFINEDtreprRR@(R=R(townertmessage((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyR@s  (RRRZRcR@(((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRscBsjeZdZddgZedZdZdZdZdZ dZ e Z Z Z d ZRS( sRepresents a reference to an undefined variable. Unlike the Python runtime, template expressions can refer to an undefined variable without causing a `NameError` to be raised. The result will be an instance of the `Undefined` class, which is treated the same as ``False`` in conditions, but raise an exception on any other operation: >>> foo = Undefined('foo') >>> bool(foo) False >>> list(foo) [] >>> print foo undefined However, calling an undefined variable, or trying to access an attribute of that variable, will raise an exception that includes the name used to reference that undefined variable. >>> foo('bar') Traceback (most recent call last): ... UndefinedError: "foo" not defined >>> foo.bar Traceback (most recent call last): ... UndefinedError: "foo" not defined :see: `LenientLookup` t_namet_ownercCs||_||_dS(sInitialize the object. :param name: the name of the reference :param owner: the owning object, if the variable is accessed as a member N(RgRh(R=R(Re((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyR@s cCs tgS(N(titer(R=((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt__iter__scCstS(N(tFalse(R=((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt __nonzero__ scCsd|ii|ifS(Ns<%s %r>(RXRRg(R=((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRYscCsdS(Nt undefined((R=((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt__str__scOst}t|i|idS(sRaise an `UndefinedError`.N(tTrueRRgRh(R=targstkwargsR_((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt_diescCsdS(i((((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRs(RRRZR[RcR@RjRlRYRnRrt__call__t __getattr__Rt__length_hint__(((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRs      t LookupBasecBszeZdZdZeeZdZeeZdZeeZdZeeZedZ ee Z RS(s8Abstract base class for variable lookup implementations.cCs7h|d6|id6|id6|id6td6td6S(snConstruct the globals dictionary to use as the execution context for the expression or suite. R]t _lookup_namet _lookup_attrt _lookup_itemR)R(t lookup_namet lookup_attrt lookup_itemR)R(tclsR^((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyR<#s   cCs_t}|i|t}|tjo6ti||}|tjo|i|}q[n|S(N(RotgetRctBUILTINSRm(R}R^R(R_tval((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRz1s  cCst}yt||}Wnltj o`t|i|oqy||}Wqttfj o|i|d|}qXnX|S(NRe(RoR tAttributeErrorRRXtKeyErrort TypeErrorRm(R}tobjtkeyR_R((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyR{;scCst}t|djo|d}ny ||SWnqttttfj oY}t|to=t||t }|t jo|i |d|}n|SnXdS(NiiRe( RotlenRRt IndexErrorRR5R6R RcRm(R}RRR_teR((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyR|Js  cCs tdS(sCan be overridden by subclasses to specify behavior when undefined variables are accessed. :param key: the name of the variable :param owner: the owning object, if the variable is accessed as a member N(tNotImplementedError(R}RRe((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRmYs( RRRZR<t classmethodRzR{R|RcRm(((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRv s      cBs&eZdZedZeeZRS(sDefault variable lookup mechanism for expressions. When an undefined variable is referenced using this lookup style, the reference evaluates to an instance of the `Undefined` class: >>> expr = Expression('nothing', lookup='lenient') >>> undef = expr.evaluate({}) >>> undef The same will happen when a non-existing attribute or item is accessed on an existing object: >>> expr = Expression('something.nil', lookup='lenient') >>> expr.evaluate({'something': dict()}) See the documentation of the `Undefined` class for details on the behavior of such objects. :see: `StrictLookup` cCst}t|d|S(sReturn an ``Undefined`` object.Re(RoR(R}RReR_((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRm{s(RRRZRcRmR(((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyR ds cBs&eZdZedZeeZRS(sStrict variable lookup mechanism for expressions. Referencing an undefined variable using this lookup style will immediately raise an ``UndefinedError``: >>> expr = Expression('nothing', lookup='strict') >>> expr.evaluate({}) Traceback (most recent call last): ... UndefinedError: "nothing" not defined The same happens when a non-existing attribute or item is accessed on an existing object: >>> expr = Expression('something.nil', lookup='strict') >>> expr.evaluate({'something': dict()}) Traceback (most recent call last): ... UndefinedError: {} has no member named "nil" cCst}t|d|dS(s(Raise an ``UndefinedError`` immediately.ReN(RoR(R}RReR_((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRms(RRRZRcRmR(((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRs R0c Cs'|i}|djog}|iD]}||iq*~}|o|d}tdi|di}|iidoJ|di o8dig}|iD]}|d|q~}ndi||g}qnt|t od|i d}nt ||S( NRais it:s %sssutf-8( tstript splitlinest expandtabsRtjointrstriptendswithtisspaceR5tunicodetencodeR(R*R.R%tlinetlinestfirsttrestR'((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyR7s  - (8c Cs|djohtd6i|t}n|i|}t|to|idd}n|p d}n||_|djo d}n|djo!t |}d|pd}n_t |}|i } | p d } n | d} t | djo| d 7} nd | }t |_|i} tid| i| i| id B| i| i| i| i|||| id dS(NR0sutf-8treplacesiisR/ts ...s i@(((RtExpressionASTTransformerR~tTemplateASTTransformertvisitR5RRR1RRRRRot optimizedtgetCodeRPR+RBRCRDRERFRGRHRL( R?R*R.R1R2R3ttreetgenR(RtextractR+((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyR;s8               RRkRoRtNotImplementedtEllipsistASTTransformercBs%eZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZeZZdZdZdZdZdZdZ dZ!dZ"e"Z#Z$Z%Z&Z'e"Z(Z)dZ*e*Z+Z,e*Z-Z.Z/Z0Z1e*Z2Z3d Z4d!Z5e5Z6Z7Z8Z9e5Z:Z;d"Z<d#Z=d$Z>d%Z?d&Z@d'ZAd(ZBd)ZCd*ZDd+ZEd,ZFd-ZGd.ZHd/ZIRS(0sGeneral purpose base class for AST transformations. Every visitor method can be overridden to return an AST node that has been altered or replaced in some way. cCs}|djodSt|tjo/tg}|D]}||i|q3~St|d|ii|i}||S(Nsvisit%s(RRRttupleRR RXRt _visitDefault(R=R?R%tntvisitor((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRs / cGst|dd}|i|}|dj o ||_nt|tititifp#t tdo t|ti o d|_ n|S(NR2tGenExprs( R RRXR2R5RtClasstFunctiontLambdaRRR1(R=R?RpR2((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt_clones  "# cCs|S(N((R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRscCs|i||i|iS(N(RRR?(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pytvisitExpressionscCs"|i||i|i|iS(N(RtdocRR?(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitModulescCs7|i|g}|iD]}||i|q~S(N(RtnodesR(R=R?R%R&((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitStmtsc Cs|i||i|ig}|iD]}||i|q&~|io|i|ipd|io|i|ipdS(N(RRR?Rpt star_argsRt dstar_args(R=R?R%R&((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitCallFuncs* c CsR|i||ig}|iD]}||i|q~|i|i|iS(N(RR(tbasesRRR+(R=R?R%R&((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitClasss9cCst p|idgjo|Stititidtidti|igdd}t |do|i |_ n|S(Nt*R)R]R2(RN( thas_star_import_bugtnamesRRtDiscardtCallFunctNametConstR"RR2(R=R?tnew_node((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitFrom s  -c Csg}t|do|i|i|in|i|||i|ig}|iD]}||i|qY~|i|i |i|i gS(Nt decorators( RtappendRRRR(targnamestdefaultstflagsRR+(R=R?RpR%R&((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitFunctions *cCs"|i||i|i|iS(N(RRtexprtattrname(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitGetattr%sc CsX|i||ig}|iD]}||i|q~|i|i|i}|S(N(RRRRRR+(R=R?R%R&((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitLambda(s0c CsL|i||i|i|ig}|iD]}||i|q,~S(N(RRRRtsubs(R=R?R%R&((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pytvisitSubscript/scCs+|i||i|i|i|iS(N(RRttesttfail(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitAssert6scCsF|i|g}|iD]}||i|q~|i|iS(N(RRRR(R=R?R%R&((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitAssign9s3cCs(|i||i|i|i|iS(N(RRRRR(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitAssAttr>scCs1|i||i|i|i|i|iS(N(RRR?topR(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pytvisitAugAssignCscCs7|i|g}|iD]}||i|q~S(N(RRR(R=R?R%R&((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pytvisitDecoratorsHscCs:|i||i|i|i|i|i|iS(N(RRRtlocalsR<(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitExecKs'cCsI|i||i|i|i|i|i|i|i|iS(N(RRtassigntlisttbodytelse_(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pytvisitForPs'cCsF|i|g}|iD]}||i|q~|i|iS(N(RttestsRR(R=R?R%R&((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pytvisitIfUs3cCsF|i|g}|iD]}||i|q~|i|iS(N(RRRtdest(R=R?R%R&((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt _visitPrintZs3cCs:|i||i|i|i|i|i|iS(N(RRtexpr1texpr2texpr3(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitRaise`s'cCs|i||i|iS(N(RRtvalue(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitReturnescCs:|i||i|i|i|i|i|iS(N(RRRthandlersR(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pytvisitTryExcepths'cCs+|i||i|i|i|iS(N(RRRtfinal(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pytvisitTryFinallymscCs:|i||i|i|i|i|i|iS(N(RRRRR(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitWhileps'cCsU|i||i|ig}|iD]}||i|q&~|i|iS(N(RRRtvarsR(R=R?R%R&((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitWithuscCs|i||i|iS(N(RRR(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitYieldzscCs7|i|g}|iD]}||i|q~S(N(RRR(R=R?R%R&((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt _visitBoolOpscCs.|i||i|i|i|ifS(N(RRtlefttright(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt _visitBinOps c CsR|i||i|ig}|iD]"\}}|||i|fq&~S(N(RRRtops(R=R?R%RR((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitComparescCs|i||i|iS(N(RRR(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt _visitUnaryOpscCs:|i||i|i|i|i|i|iS(N(RRRtthenR(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitIfExps'cCsL|i|g}|iD]+\}}||i||i|fq~S(N(RtitemsR(R=R?R%tktv((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitDicts cCs|i||i|iS(N(RRR+(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitGenExprsc CsU|i||i|i|i|ig}|iD]}||i|q5~S(N(RRRRitifs(R=R?R%R&((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pytvisitGenExprFors'cCs|i||i|iS(N(RRR(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pytvisitGenExprIfscCsLg}|iD]}||i|q~}|i||i|i|S(N(tqualsRRR(R=R?R%R&R((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pytvisitGenExprInners-cCs"|i||i|i|iS(N(RR(RR(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitKeywordscCs7|i|g}|iD]}||i|q~S(N(RRR(R=R?R%R((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitListscCsLg}|iD]}||i|q~}|i||i|i|S(N(RRRR(R=R?R%R&R((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitListComps-c CsU|i||i|i|i|ig}|iD]}||i|q5~S(N(RRRRR(R=R?R%R&((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pytvisitListCompFors'cCs|i||i|iS(N(RRR(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pytvisitListCompIfscCsb|i||i|i|i|io|i|ipd|io|i|ipdS(N(RRRRtlowerRtupper(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitSlices cCs7|i|g}|iD]}||i|q~S(N(RRR(R=R?R%R&((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitSliceobjscCs7|i|g}|iD]}||i|q~S(N(RRR(R=R?R%R((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitTuples(JRRRZRRRRRRRRRRRRRRRRRRRRRRt visitPrintt visitPrintnlRRRRRRRRtvisitAndtvisitOrt visitBitandt visitBitort visitBitxort visitAssTuplet visitAssListRtvisitAddtvisitSubtvisitDivt visitFloorDivtvisitModtvisitMult visitPowertvisitLeftShifttvisitRightShiftRRt visitUnaryAddt visitUnarySubtvisitNott visitInverttvisitBackquotet visitDiscardRRRRRRRRRRRR R R (((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRsp                                               RcBsqeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z RS( spConcrete AST transformer that implements the AST transformations needed for code embedded in templates. cCstg|_dS(N(t CONSTANTSR(R=((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyR@scCs[t|itoDy|iidWqWtj oti|iidSXn|S(Ntasciisutf-8(R5Rtstrtdecodet ValueErrorRR(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitConsts cCs5t|idjo|idi|in|S(Nii(RRtaddR((R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitAssNamescCst|itio|iit|ijo|ii}titiddti|g|_|i |i |_ ti ti ti|dtidfgti |gfgti tititidti|gddgSti||SdS(NR]tOP_APPLYtinR(R5R?RRR(R Rt SubscriptRRRtIftComparetStmttRaiseRRRR(R=R?R(((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRs *cCsmt|idjo|idi|in|iitzti||SWd|iiXdS(Nii( RRR*R(RtsetRRtpop(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRs cCs<|iitzti||SWd|iiXdS(N(RRR3RRR4(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRscCsst|idjo|idi|in|iit|izti||SWd|ii XdS(Nii( RRR*R(RR3RRRR4(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRs cCs<|iitzti||SWd|iiXdS(N(RRR3RRR4(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRscCsH|iitt|izti||SWd|iiXdS(N(RRR3R RRRR4(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRscCs<|iitzti||SWd|iiXdS(N(RRR3RRR4(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRscCs]|it|ijo@tidti|ig}titid|}n|S(NR]Rw(R(R RRRRR(R=R?t func_args((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyt visitName#s!(RRRZR@R)R+RRRRRRRR6(((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyRs        RcBs eZdZdZdZRS(spConcrete AST transformer that implements the AST transformations needed for code embedded in templates. cCs7titid|i|iti|igS(NRx(RRRRRRR(R=R?((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyR2sc Cs[titid|i|itig}|iD]}||i|q5~gS(NRy(RRRRRtTupleR(R=R?R%tsub((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyR8s(RRRZRR(((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pyR-s (5RZt __builtin__tcompilerRRtcompiler.pycodegenRRRPR3t NameErrortsetsRt frozensetRttextwrapRt genshi.coreRtgenshi.template.baseRt genshi.utilR Rt __docformat__RkRtobjectRt SystemErrorRoRR)R R R RcRRRvR RR7RR;RtcopyRRR$RRR(((s:/usr/lib64/python2.6/site-packages/genshi/template/eval.pytsX     E7 CD   %]