/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/sandbox.pyo (12271B)
Ñò ÈÏRc!@sódZddkZddklZddklZddklZlZl Z l Z l Z l Z l Z lZdZeddd d d gƒZed d dgƒZeddgƒZep eƒZnddkZeiddeddƒddklZefZefZefZyGddklZlZddk l Z eeef7Zee f7ZWne!j onXy!ddk"l#Z#ee#f7ZWne!j onXyGddkl$Z$l%Z%l&Z&ee$f7Zee%f7Zee&f7ZWne!j onXee'ddddddd d!gƒfee'ddd"d#d!gƒfee'd$d%d&d'd(dgƒfee'd$d)dd(d*dd+dd,g ƒffZ(d-„Z)d.„Z*d/„Z+d0„Z,d1efd2„ƒYZ-d3e-fd4„ƒYZ.dS(5sj 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_typetPY2i †t func_closuret func_codet func_dictt func_defaultst func_globalstim_classtim_functim_selftgi_frametgi_codetignoresthe sets moduletmodulesjinja2.sandbox(tdeque(tUserDictt DictMixin(tUserList(tSet(t MutableSettMutableMappingtMutableSequencetaddtcleartdifference_updatetdiscardtpoptremovetsymmetric_difference_updatetupdatetpopitemt setdefaulttappendtreversetinserttsorttextendt appendleftt extendlefttpoplefttrotatecGs7t|Œ}t|ƒtjotdtƒ‚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((s?/opt/alt/python27/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((s?/opt/alt/python27/lib/python2.7/site-packages/jinja2/sandbox.pytunsafeks cCsÐt|tƒo|tjotSnžt|tƒo#|tjp |tjotSnkt|tƒo|djotSnEt|ttt fƒotSt|t ƒo|t jotSn|i dƒ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__( t isinstanceRtUNSAFE_FUNCTION_ATTRIBUTESR8RtUNSAFE_METHOD_ATTRIBUTESttypeRRRRtUNSAFE_GENERATOR_ATTRIBUTESt startswith(tobjtattr((s?/opt/alt/python27/lib/python2.7/site-packages/jinja2/sandbox.pytis_internal_attributexs          cCs6x/tD]'\}}t||ƒo ||jSqWtS(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_specR>tFalse(RDREttypespecR;((s?/opt/alt/python27/lib/python2.7/site-packages/jinja2/sandbox.pytmodifies_known_mutable˜s  tSandboxedEnvironmentcBsæeZdZeZheid6eid6eid6ei d6ei d6ei d6ei d6Z heid6eid6ZeƒZeƒ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 occour during the rendering so the caller has to ensure that all exceptions are catched. 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 (RH(tselftoperator((s?/opt/alt/python27/lib/python2.7/site-packages/jinja2/sandbox.pytintercept_unopôscOsHti|||Žt|id<|iiƒ|_|iiƒ|_dS(NR1( Rt__init__R7tglobalstdefault_binop_tabletcopyt binop_tabletdefault_unop_tablet unop_table(RQR5tkwargs((s?/opt/alt/python27/lib/python2.7/site-packages/jinja2/sandbox.pyRTs cCs|idƒp t||ƒ 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_(RCRF(RQRDREtvalue((s?/opt/alt/python27/lib/python2.7/site-packages/jinja2/sandbox.pytis_safe_attribute scCs$t|dtƒpt|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. R9t alters_data(tgetattrRH(RQRD((s?/opt/alt/python27/lib/python2.7/site-packages/jinja2/sandbox.pytis_safe_callablescCs|i|||ƒ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 (RX(RQtcontextRRtlefttright((s?/opt/alt/python27/lib/python2.7/site-packages/jinja2/sandbox.pyt call_binopscCs|i||ƒ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 (RZ(RQRbRRtarg((s?/opt/alt/python27/lib/python2.7/site-packages/jinja2/sandbox.pyt call_unop'sc CsÌy ||SWn§ttfj o•t|tƒo~yt|ƒ}Wntj oq±Xyt||ƒ}Wntj oq±X|i|||ƒo|S|i ||ƒSq¶nX|i d|d|ƒS(s(Subscribe an object from sandboxed code.RDtname( t TypeErrort LookupErrorR>Rtstrt ExceptionR`tAttributeErrorR^tunsafe_undefinedt undefined(RQRDtargumentRER]((s?/opt/alt/python27/lib/python2.7/site-packages/jinja2/sandbox.pytgetitem0s  cCs’yt||ƒ}Wn;tj o/y ||SWq|ttfj oq|Xn-X|i|||ƒo|S|i||ƒS|id|d|ƒS(s€Subscribe an object from sandboxed code and prefer the attribute. The attribute passed *must* be a bytestring. RDRh(R`RmRiRjR^RnRo(RQRDt attributeR]((s?/opt/alt/python27/lib/python2.7/site-packages/jinja2/sandbox.pyR`Es  cCs/|id||iifd|d|dtƒS(s1Return an undefined object for unsafe attributes.s.access to attribute %r of %r object is unsafe.RhRDtexc(Rot __class__t__name__R(RQRDRr((s?/opt/alt/python27/lib/python2.7/site-packages/jinja2/sandbox.pyRnVs cOs:|i|ƒptd|fƒ‚n|i|||ŽS(s#Call an object from sandboxed code.s%r is not safely callable(RaRtcall(t_SandboxedEnvironment__selft_SandboxedEnvironment__contextt_SandboxedEnvironment__objR5R[((s?/opt/alt/python27/lib/python2.7/site-packages/jinja2/sandbox.pyRv^s(Rut __module__t__doc__R8t sandboxedRRRtsubtmulttruedivtfloordivtpowtmodRVtpostnegRYt frozensettintercepted_binopstintercepted_unopsRSRTR^RaReRgRqR`RnRv(((s?/opt/alt/python27/lib/python2.7/site-packages/jinja2/sandbox.pyRK´s2                 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,ti||||ƒptSt||ƒ S(N(RKR^RHRJ(RQRDRER]((s?/opt/alt/python27/lib/python2.7/site-packages/jinja2/sandbox.pyR^ms(RuRzR{R^(((s?/opt/alt/python27/lib/python2.7/site-packages/jinja2/sandbox.pyRˆgs(/R{RRtjinja2.environmentRtjinja2.exceptionsRtjinja2._compatRRRRRRRR R3tsetR?R@RBtwarningstfilterwarningstDeprecationWarningt collectionsRt_mutable_set_typestdictt_mutable_mapping_typestlistt_mutable_sequence_typesRRRt ImportErrortsetsRRRRR…RGR7R;RFRJRKRˆ(((s?/opt/alt/python27/lib/python2.7/site-packages/jinja2/sandbox.pytsj :         ³