Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
ó ÖÎ6ic@sdZddlZddlZddlmZddlmZddlmZm Z m Z m Z m Z m Z mZmZmZddlmZddlmZeZeedƒrÌdd lmZeZnd Zed d d ddgƒZedddgƒZeddgƒZeddgƒZ eddgƒZ!esJeƒZnddl"Z"e"j#dde$ddƒddl%m&Z&efZ'e(fZ)e*fZ+yGddl,m,Z,m-Z-ddl.m.Z.e)e,e-f7Z)e'e.f7Z'Wne/k rônXy!dd l0m1Z1e'e1f7Z'Wne/k r)nXyGdd!l%m2Z2m3Z3m4Z4e'e2f7Z'e)e3f7Z)e+e4f7Z+Wne/k r„nXe'e5d"d#d$d%d&d'd(d)gƒfe)e5d#d&d*d+d)gƒfe+e5d,d-d.d/d0d'gƒfe&e5d,d1d#d0d2d&d3d'd4g ƒffZ6eedƒrCd5efd6„ƒYZ7nd7„Z8d8„Z9d9„Z:d:„Z;d;efd<„ƒYZ<d=e<fd>„ƒYZ=erydd?l>m?Z?Wne/k rÉd@„Z?nXdAe@fdB„ƒYZAdCeAefdD„ƒYZBdEeAe7fdF„ƒYZCndS(Gsj jinja2.sandbox ~~~~~~~~~~~~~~ Adds a sandbox layer to Jinja as it was the default behavior in the old Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the default behavior is easier to use. The behavior can be changed by subclassing the environment. :copyright: (c) 2010 by the Jinja Team. :license: BSD. iÿÿÿÿN(t Environment(t SecurityError( t string_typest function_typet method_typettraceback_typet code_typet frame_typetgenerator_typet text_typetPY2(tMarkup(tupdate_wrappertformat(t Formatteri †t func_closuret func_codet func_dictt func_defaultst func_globalstim_classtim_functim_selftgi_frametgi_codetcr_frametcr_codetag_codetag_frametignoresthe sets moduletmodulesjinja2.sandbox(tdeque(tUserDictt DictMixin(tUserList(tSet(t MutableSettMutableMappingtMutableSequencetaddtcleartdifference_updatetdiscardtpoptremovetsymmetric_difference_updatetupdatetpopitemt setdefaulttappendtreversetinserttsorttextendt appendleftt extendlefttpoplefttrotatetEscapeFormattercBseZd„Zd„ZRS(cCs ||_dS(N(tescape(tselfR;((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyt__init__tscCs”t|dƒr!|j|ƒ}n`t|dƒrf|rWtdj|t|ƒƒƒ‚n|jƒ}ntj||t|ƒƒ}t|j |ƒƒS(Nt__html_format__t__html__sžFormat specifier {0} given, but {1} does not define __html_format__. A class that defines __html__ must define __html_format__ to work with format specifiers.( thasattrR>t ValueErrorR ttypeR?Rt format_fieldR R;(R<tvaluet format_spectrv((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyRCws(t__name__t __module__R=RC(((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyR:ss cGs5t|Œ}t|ƒtkr1tdtƒ‚n|S(sWA range that can't generate ranges with a length of more than MAX_RANGE items. s+range too big, maximum size for range is %d(trangetlent MAX_RANGEt OverflowError(targstrng((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyt safe_rangeŒs   cCs t|_|S(snMarks a function or method as unsafe. :: @unsafe def delete(self): pass (tTruetunsafe_callable(tf((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pytunsafe—s cCs%t|tƒr"|tkrtSnöt|tƒrP|tksI|tkrtSnÈt|tƒrr|dkrtSn¦t|ttt fƒrŽtSt|t ƒr°|t krtSnht t dƒrät|t jƒrä|tkrtSn4t t dƒrt|t jƒrttkrtSn|jdƒS(s Test if the attribute given is an internal python attribute. For example this function returns `True` for the `func_code` attribute of python objects. This is useful if the environment method :meth:`~SandboxedEnvironment.is_safe_attribute` is overridden. >>> from jinja2.sandbox import is_internal_attribute >>> is_internal_attribute(lambda: None, "func_code") True >>> is_internal_attribute((lambda x:x).func_code, 'co_code') True >>> is_internal_attribute(str, "upper") False tmrot CoroutineTypetAsyncGeneratorTypet__(t isinstanceRtUNSAFE_FUNCTION_ATTRIBUTESRPRtUNSAFE_METHOD_ATTRIBUTESRBRRRRtUNSAFE_GENERATOR_ATTRIBUTESR@ttypesRUtUNSAFE_COROUTINE_ATTRIBUTESRVtattrit!UNSAFE_ASYNC_GENERATOR_ATTRIBUTESt startswith(tobjtattr((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pytis_internal_attribute¤s,     ! ! cCs4x-tD]%\}}t||ƒr||kSqWtS(s³This function checks if an attribute on a builtin mutable object (list, dict, set or deque) would modify it if called. It also supports the "user"-versions of the objects (`sets.Set`, `UserDict.*` etc.) and with Python 2.6 onwards the abstract base classes `MutableSet`, `MutableMapping`, and `MutableSequence`. >>> modifies_known_mutable({}, "clear") True >>> modifies_known_mutable({}, "keys") False >>> modifies_known_mutable([], "append") True >>> modifies_known_mutable([], "index") False If called with an unsupported object (such as unicode) `False` is returned. >>> modifies_known_mutable("foo", "upper") False (t _mutable_specRXtFalse(RaRbttypespecRS((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pytmodifies_known_mutableÊstSandboxedEnvironmentcBsïeZdZeZiejd6ejd6ejd6ej d6ej d6ej d6ej d6Z iejd6ejd6ZeƒZeƒZd„Zd „Zd „Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„ZRS(séThe sandboxed environment. It works like the regular environment but tells the compiler to generate sandboxed code. Additionally subclasses of this environment may override the methods that tell the runtime what attributes or functions are safe to access. If the template tries to access insecure code a :exc:`SecurityError` is raised. However also other exceptions may occur during the rendering so the caller has to ensure that all exceptions are caught. t+t-t*t/s//s**t%cCstS(s”Called during template compilation with the name of a unary operator to check if it should be intercepted at runtime. If this method returns `True`, :meth:`call_unop` is excuted for this unary operator. The default implementation of :meth:`call_unop` will use the :attr:`unop_table` dictionary to perform the operator with the same logic as the builtin one. The following unary operators are interceptable: ``+`` and ``-`` Intercepted calls are always slower than the native operator call, so make sure only to intercept the ones you are interested in. .. versionadded:: 2.6 (Re(R<toperator((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pytintercept_unop&scOsHtj|||Žt|jd<|jjƒ|_|jjƒ|_dS(NRI( RR=ROtglobalstdefault_binop_tabletcopyt binop_tabletdefault_unop_tablet unop_table(R<RMtkwargs((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyR=8s cCs|jdƒpt||ƒ S(sYThe sandboxed environment will call this method to check if the attribute of an object is safe to access. Per default all attributes starting with an underscore are considered private as well as the special attributes of internal python objects as returned by the :func:`is_internal_attribute` function. t_(R`Rc(R<RaRbRD((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pytis_safe_attribute>scCs#t|dtƒp!t|dtƒ S(sCheck if an object is safely callable. Per default a function is considered safe unless the `unsafe_callable` attribute exists and is True. Override this method to alter the behavior, but this won't affect the `unsafe` decorator from this module. RQt alters_data(tgetattrRe(R<Ra((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pytis_safe_callableGscCs|j|||ƒS(s÷For intercepted binary operator calls (:meth:`intercepted_binops`) this function is executed instead of the builtin operator. This can be used to fine tune the behavior of certain operators. .. versionadded:: 2.6 (Rs(R<tcontextRntlefttright((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyt call_binopPscCs|j||ƒS(sõFor intercepted unary operator calls (:meth:`intercepted_unops`) this function is executed instead of the builtin operator. This can be used to fine tune the behavior of certain operators. .. versionadded:: 2.6 (Ru(R<R|Rntarg((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyt call_unopYscCsáy ||SWn¼ttfk rÊt|tƒrËyt|ƒ}Wntk rTqÇXyt||ƒ}Wntk r{qÇX|j|ƒ}|dk r›|S|j |||ƒr´|S|j ||ƒSqËnX|j d|d|ƒS(s(Subscribe an object from sandboxed code.RatnameN( t TypeErrort LookupErrorRXRtstrt ExceptionRztAttributeErrortwrap_str_formattNoneRxtunsafe_undefinedt undefined(R<RatargumentRbRDtfmt((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pytgetitembs&    cCs«yt||ƒ}Wn7tk rLy ||SWq•ttfk rHq•XnIX|j|ƒ}|dk rl|S|j|||ƒr…|S|j||ƒS|jd|d|ƒS(s€Subscribe an object from sandboxed code and prefer the attribute. The attribute passed *must* be a bytestring. RaR‚N( RzR‡RƒR„RˆR‰RxRŠR‹(R<Rat attributeRDR�((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyRzzs   cCs/|jd||jjfd|d|dtƒS(s1Return an undefined object for unsafe attributes.s.access to attribute %r of %r object is unsafe.R‚Ratexc(R‹t __class__RGR(R<RaR�((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyRŠŽs cs¸t|tjtjfƒ s+|jdkr/dS|j‰tˆtƒsKdStˆƒ‰d}tˆt ƒr�t |ˆj ƒ}n t |ƒ}|j ‰‡‡‡fd†}t||ƒS(s(If the given value is a ``str.format`` method, return a new function that handles sandboxing. This is done at access rather than in :meth:`call`, so that calls made without ``call`` are also sandboxed. Note: Python 2 only supports str.format, not str.format_map. R csˆˆˆ||ƒƒS(N((RMRv(tf_selftstr_typetvformat(s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pytwrapper±sN(RXR\t MethodTypetBuiltinMethodTypeRGR‰t__self__RRBR tSandboxedEscapeFormatterR;tSandboxedFormatterR”R (R<RDt formatterR•((R’R“R”s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyRˆ–s    cOs8|j|ƒs%td|fƒ‚n|j|||ŽS(s#Call an object from sandboxed code.s%r is not safely callable(R{Rtcall(t_SandboxedEnvironment__selft_SandboxedEnvironment__contextt_SandboxedEnvironment__objRMRv((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyRœ¶s(RGRHt__doc__RPt sandboxedRnR'tsubtmulttruedivtfloordivtpowtmodRqtpostnegRtt frozensettintercepted_binopstintercepted_unopsRoR=RxR{RR�RŽRzRŠRˆRœ(((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyRhæs4                  tImmutableSandboxedEnvironmentcBseZdZd„ZRS(sÓWorks exactly like the regular `SandboxedEnvironment` but does not permit modifications on the builtin mutable objects `list`, `set`, and `dict` by using the :func:`modifies_known_mutable` function. cCs*tj||||ƒstSt||ƒ S(N(RhRxReRg(R<RaRbRD((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyRxÆs(RGRHR Rx(((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyR­Às(tformatter_field_name_splitcCs |jƒS(N(t_formatter_field_name_split(t field_name((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyR®ÑstSandboxedFormatterMixincBseZd„Zd„ZRS(cCs ||_dS(N(t_env(R<tenv((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyR=Ösc Cs{t|ƒ\}}|j|||ƒ}xG|D]?\}}|rX|jj||ƒ}q.|jj||ƒ}q.W||fS(N(R®t get_valueR²RzRŽ( R<R°RMRvtfirsttrestRatis_attrti((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyt get_fieldÙs(RGRHR=R¹(((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyR±Ôs RšcBseZd„ZRS(cCs!tj||ƒtj|ƒdS(N(R±R=R(R<R³((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyR=äs(RGRHR=(((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyRšãsR™cBseZd„ZRS(cCs$tj||ƒtj||ƒdS(N(R±R=R:(R<R³R;((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyR=és(RGRHR=(((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyR™ès(DR R\Rntjinja2.environmentRtjinja2.exceptionsRtjinja2._compatRRRRRRRR R t jinja2.utilsR t functoolsR Ret has_formatR@tstringRRPRKtsetRYRZR[R]R_twarningstfilterwarningstDeprecationWarningt collectionsRt_mutable_set_typestdictt_mutable_mapping_typestlistt_mutable_sequence_typesR R!R"t ImportErrortsetsR#R$R%R&RªRdR:RORSRcRgRhR­t_stringR®tobjectR±RšR™(((s2/usr/lib/python2.7/site-packages/jinja2/sandbox.pyts�  @              & Ú