/usr/local/lib/python3.6/site-packages/werkzeug/__pycache__
NameSizeModeActions
datastructures.cpython-36.pyc1077480644editdlrm
exceptions.cpython-36.pyc306390644editdlrm
filesystem.cpython-36.pyc20250644editdlrm
formparser.cpython-36.pyc138140644editdlrm
http.cpython-36.pyc379050644editdlrm
local.cpython-36.pyc226910644editdlrm
routing.cpython-36.pyc729310644editdlrm
security.cpython-36.pyc80400644editdlrm
serving.cpython-36.pyc304780644editdlrm
test.cpython-36.pyc389610644editdlrm
testapp.cpython-36.pyc95490644editdlrm
urls.cpython-36.pyc364140644editdlrm
useragents.cpython-36.pyc74170644editdlrm
user_agent.cpython-36.pyc17200644editdlrm
utils.cpython-36.pyc329600644editdlrm
wsgi.cpython-36.pyc301020644editdlrm
_internal.cpython-36.pyc182680644editdlrm
_reloader.cpython-36.pyc118990644editdlrm
__init__.cpython-36.pyc3100644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/werkzeug/__pycache__/local.cpython-36.pyc (22691B)
3 _TBgp\@sHddlZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z ej r~ddl mZddl mZddl mZejd ejd ejfd Zydd lmZWn ek rdd lmZYnXedddZGdddeZyddlmZdej ksdej krxddlZe!eddZ"e"sxyddl#m$Z$Wnek rVedYn"Xe$ddrxe$dd rxeejddddZ%Wn:eefk rGd ddZejddd!dZ%YnXej&d4dd$d%d&Z'Gd'd"d"Z(Gd(d#d#Z)Gd)d*d*Z*Gd+d,d,Z+Gd-d.d.e+Z,eed/d0d1Z-Gd2d3d3Z.dS)5N)partial)update_wrapper)ClosingIterator) StartResponse)WSGIApplication)WSGIEnvironmentF.)Zbound) getcurrent) get_ident)returncCstjdtddtS)Nz'get_ident' is deprecated and will be removed in Werkzeug 2.1. Use 'greenlet.getcurrent' or 'threading.get_ident' for previous behavior.) stacklevel)warningswarnDeprecationWarning _get_identrr2/tmp/pip-build-0s3hx122/Werkzeug/werkzeug/local.pyr s r c@s eZdZdS)_CannotUseContextVarN)__name__ __module__ __qualname__rrrrr$sr) ContextVarZgeventZeventletZGREENLET_USE_CONTEXT_VARSF)is_object_patched threadinglocal contextvarsr)storager cCs|jidS)N)set)rrrr__release_local__@sr c@sdeZdZdZeddddZejeejfejeejfdddZ ejeejfdd d d Z dS) rzA fake ContextVar based on the previous greenlet/threading ident function. Used on Python 3.6, eventlet, and old versions of gevent. N)_namer cCs i|_dS)N)r)selfr!rrr__init__MszContextVar.__init__)defaultr cCs|jjt|S)N)rgetr)r"r$rrrr%PszContextVar.get)valuer cCs||jt<dS)N)rr)r"r&rrrrSszContextVar.set) rrr__doc__strr#tDictAnyr%rrrrrrGs(cCs|jjtddS)N)rpopr)rrrrr VsLocal LocalStack)rr cCs |jdS)aMReleases the contents of the local for the current context. This makes it possible to use locals without a manager. Example:: >>> loc = Local() >>> loc.foo = 42 >>> release_local(loc) >>> hasattr(loc, 'foo') False With this function one can release :class:`Local` objects as well as :class:`LocalStack` objects. However it is not possible to release data held by proxies that way, one always has to retain a reference to the underlying local object in order to be able to release it. .. versionadded:: 0.6.1 N)r )rrrr release_local\sr/c@seZdZdZddddZeejeej fdddZ eej ge fddd Z e jej ge fdd d d Z ejeje ej fdd d ZeddddZddddZeej dddZeej ddddZeddddZdS)r-_storageN)r cCstj|dtddS)Nr0Z local_storage)object __setattr__r)r"rrrr#vszLocal.__init__cCstjdtdd|jjiS)Nz@'__storage__' is deprecated and will be removed in Werkzeug 2.1.r )r)rrrr0r%)r"rrr __storage__ys zLocal.__storage__cCstjdtddtS)Nzi'__ident_func__' is deprecated and will be removed in Werkzeug 2.1. It should not be used in Python 3.7+.r )r)rrrr)r"rrr__ident_func__s zLocal.__ident_func__)funcr cCstjdtdddS)Nzh'__ident_func__' is deprecated and will be removed in Werkzeug 2.1. Setting it no longer has any effect.r )r)rrr)r"r5rrrr4scCst|jjijS)N)iterr0r%items)r"rrr__iter__szLocal.__iter__ LocalProxy)proxyr cCs t||S)zCreate a proxy for a name.)r9)r"r:rrr__call__szLocal.__call__cCst|jdS)N)r r0)r"rrrr szLocal.__release_local__)namer c Cs8|jji}y||Stk r2t|dYnXdS)N)r0r%KeyErrorAttributeError)r"r<valuesrrr __getattr__s  zLocal.__getattr__)r<r&r cCs(|jjij}|||<|jj|dS)N)r0r%copyr)r"r<r&r?rrrr2szLocal.__setattr__c CsJ|jjij}y||=|jj|Wntk rDt|dYnXdS)N)r0r%rArr=r>)r"r<r?rrr __delattr__s zLocal.__delattr__)r0)rrr __slots__r#propertyr)r*r(r+r3Callableintr4setterIteratorZTupler8r;r r@r2rBrrrrr-ss  c@seZdZdZddddZddddZeejge fddd Z e j ejge fdd d d Z d dd dZ ej ejej dddZej dddZeej dddZdS)r.aThis class works similar to a :class:`Local` but keeps a stack of objects instead. This is best explained with an example:: >>> ls = LocalStack() >>> ls.push(42) >>> ls.top 42 >>> ls.push(23) >>> ls.top 23 >>> ls.pop() 23 >>> ls.top 42 They can be force released by using a :class:`LocalManager` or with the :func:`release_local` function but the correct way is to pop the item from the stack after using. When the stack is empty it will no longer be bound to the current context (and as such released). By calling the stack without arguments it returns a proxy that resolves to the topmost item on the stack. .. versionadded:: 0.6.1 N)r cCs t|_dS)N)r-_local)r"rrrr#szLocalStack.__init__cCs|jjdS)N)rIr )r"rrrr szLocalStack.__release_local__cCs|jjS)N)rIr4)r"rrrr4szLocalStack.__ident_func__)r&r cCstj|jd|dS)Nr4)r1r2rI)r"r&rrrr4sr9cstjdfdd }t|S)N)r csj}|dkrtd|S)Nzobject unbound)top RuntimeError)rv)r"rr_lookupsz$LocalStack.__call__.._lookup)r)r+r9)r"rMr)r"rr;szLocalStack.__call__)objr cCs(t|jdgj}|j|||j_|S)zPushes a new item to the stackstack)getattrrIrAappendrO)r"rNrLrrrpushs zLocalStack.pushcCsDt|jdd}|dkrdSt|dkr8t|j|dS|jSdS)z}Removes the topmost item from the stack, will return the old value or `None` if the stack was already empty. rONr)rPrIlenr/r,)r"rOrrrr,s  zLocalStack.popc Cs*y |jjdSttfk r$dSXdS)z[The topmost item on the stack. If the stack is empty, `None` is returned. rNrS)rIrOr> IndexError)r"rrrrJs zLocalStack.top)rrrr'r#r rDr)rErFr4rGr;r+ZListrRr,rJrrrrr.s  c@seZdZdZdejejejee fdddddZ e ej ge fdddZejej ge fdd d dZe dd d Zddd dZdddddZddd ddZedddZdS) LocalManagera[Local objects cannot manage themselves. For that you need a local manager. You can pass a local manager multiple locals or add them later by appending them to `manager.locals`. Every time the manager cleans up, it will clean up all the data left in the locals for this context. .. versionchanged:: 2.0 ``ident_func`` is deprecated and will be removed in Werkzeug 2.1. .. versionchanged:: 0.6.1 The :func:`release_local` function can be used instead of a manager. .. versionchanged:: 0.7 The ``ident_func`` parameter was added. N)locals ident_funcr cCsJ|dkrg|_nt|tr$|g|_n t||_|dk rFtjdtdddS)Nzd'ident_func' is deprecated and will be removed in Werkzeug 2.1. Setting it no longer has any effect.r )r)rW isinstancer-listrrr)r"rWrXrrrr#s   zLocalManager.__init__)r cCstjdtddtS)Nz?'ident_func' is deprecated and will be removed in Werkzeug 2.1.r )r)rrrr)r"rrrrX,s zLocalManager.ident_func)r5r cCstjdtdddS)Nzc'ident_func' is deprecated and will be removedin Werkzeug 2.1. Setting it no longer has any effect.r )r)rrr)r"r5rrrrX5scCstjdtdd|jS)a*Return the context identifier the local objects use internally for this context. You cannot override this method to change the behavior but use it to link other context local objects (such as SQLAlchemy's scoped sessions) to the Werkzeug locals. .. deprecated:: 2.0 Will be removed in Werkzeug 2.1. .. versionchanged:: 0.7 You can pass a different ident function to the local manager that will then be propagated to all the locals passed to the constructor. z>'get_ident' is deprecated and will be removed in Werkzeug 2.1.r )r)rrrrX)r"rrrr >s zLocalManager.get_identcCsx|jD] }t|qWdS)zManually clean up the data in the locals for this context. Call this at the end of the request or use `make_middleware()`. N)rWr/)r"rrrrcleanupSs zLocalManager.cleanupr)appr cs"ddtjtdfdd }|S)zWWrap a WSGI application so that cleaning up happens after request end. rr)environstart_responser cst||jS)N)rr[)r]r^)r\r"rr application_sz1LocalManager.make_middleware..application)r)Iterablebytes)r"r\r_r)r\r"rmake_middlewareZszLocalManager.make_middlewarecCst|j||S)asLike `make_middleware` but for decorating functions. Example usage:: @manager.middleware def application(environ, start_response): ... The difference to `make_middleware` is that the function passed will have all the arguments copied from the inner application (name, docstring, module). )rrb)r"r5rrr middlewarefs zLocalManager.middlewarecCsdt|jdt|jdS)N)typerrTrW)r"rrr__repr__uszLocalManager.__repr__)NN)rrrr'r)Optionalr`Unionr-r.r#rDrErFrXrGr r[rbrcr(rgrrrrrVs rVc@seZdZdZdZdejejejejejeje dd d d Z d e dd ddZ dd eje ejdddZe dddZd ejejejdddZdS) _ProxyLookupaDescriptor that handles proxied attribute lookup for :class:`LocalProxy`. :param f: The built-in function this attribute is accessed through. Instead of looking up the special method, the function call is redone on the object. :param fallback: Return this function if the proxy is unbound instead of raising a :exc:`RuntimeError`. :param is_attr: This proxied name is an attribute, not a function. Call the fallback immediately to get the value. :param class_value: Value to return when accessed from the ``LocalProxy`` class directly. Used for ``__doc__`` so building docs still works. bind_ffallbackis_attr class_valuer<NF)frlrnrmr csjtdr&dtjtjdfdd }n(dk rJdtjtjdfdd }nd}||_||_||_||_dS)N__get__r9)instancerNr csj|t|S)N)rprf)rqrN)rorrrksz%_ProxyLookup.__init__..bind_fcs t|S)N)r)rqrN)rorrrks)hasattrr)r+rErkrlrnrm)r"rorlrnrmrkr)rorr#s z_ProxyLookup.__init__r9)ownerr<r cCs ||_dS)N)r<)r"rsr<rrr __set_name__sz_ProxyLookup.__set_name__)rqrsr c Cs|dkr|jdk r|jS|Sy |j}Wn:tk rb|jdkrD|jj||}|jr^|S|SX|jdk rz|j||St||jS)N) rn_get_current_objectrKrlrprmrkrPr<)r"rqrsrNrlrrrrps      z_ProxyLookup.__get__)r cCs d|jS)Nzproxy )r<)r"rrrrgsz_ProxyLookup.__repr__)rqargskwargsr cOs|j|t|||S)zSupport calling unbound methods from the class. For example, this happens with ``copy.copy``, which does ``type(x).__copy__(x)``. ``type(x)`` can't be proxied, so it returns the proxy type and descriptor. )rprf)r"rqrvrwrrrr;sz_ProxyLookup.__call__)rkrlrmrnr<)NNNF)N)rrrr'rCr)rhrEr+boolr#r(rtrfrprgr;rrrrrjys"rjcs@eZdZdZfZdejejejejddfdd ZZ S) _ProxyIOpzLook up an augmented assignment method on a proxied object. The method is wrapped to return the proxy instead of the object. N)rorlr cs2tj|dtjtjdfdd }||_dS)Nr9)rqrNr cs,tjtjddfdd }|j|t|S)Nr9)r"otherr cs||S)Nr)r"rz)rorqrri_ops z0_ProxyIOp.__init__..bind_f..i_op)r)r+rprf)rqrNr{)ro)rqrrksz"_ProxyIOp.__init__..bind_f)superr#r)r+rErk)r"rorlrk) __class__)rorr#sz_ProxyIOp.__init__)NN) rrrr'rCr)rhrEr# __classcell__rr)r}rrysry)opr cs(tjtjtjdfdd }tjt|S)z5Swap the argument order to turn an l-op into an r-op.)rNrzr cs ||S)Nr)rNrz)rrrr_opsz_l_to_r_op..r_op)r)r+castr )rrr)rr _l_to_r_opsrc@seZdZdZdZdejdejgejffej e dddd Z ejd d d Z e ed dddZe edddZe e Ze eZe Ze ejZe ejZe ejZe ejZe ejZe ejZ e e!Z"e e#dddZ$e e%Z&e e'Z(e e)Z*e e+dddZ,e ddddZ-e ddZ.e ddZ/e ddZ0e e1Z2e ej3Z4e ej5Z6e ej7Z8e ej9Z:e e;Ze e?Z@e ejAZBe ejCZDe ejEZFe ejGZHe ejIZJe ejKZLe ejMZNe ejOZPe eQZRe eSZTe ejUZVe ejWZXe ejYZZe ej[Z\e ej]Z^e e_ejCZ`e e_ejEZae e_ejGZbe e_ejIZce e_ejKZde e_ejMZee e_ejOZfe e_eQZge e_eSZhe e_ejUZie e_ejWZje e_ejYZke e_ej[Zle e_ej]ZmenejoZpenejqZrenejsZtenejuZvenejwZxenejyZzenej{Z|enej}Z~enejZenejZenejZenejZenejZe ejZe ejZe eZe ejZe eZe eZe eZe ejZe eZe ejZe ejZe ejZe Ze Ze Ze Ze Ze Ze Ze ejZe ejZdS)r9auA proxy to the object bound to a :class:`Local`. All operations on the proxy are forwarded to the bound object. If no object is bound, a :exc:`RuntimeError` is raised. .. code-block:: python from werkzeug.local import Local l = Local() # a proxy to whatever l.user is set to user = l("user") from werkzeug.local import LocalStack _request_stack = LocalStack() # a proxy to _request_stack.top request = _request_stack() # a proxy to the session attribute of the request proxy session = LocalProxy(lambda: request.session) ``__repr__`` and ``__class__`` are forwarded, so ``repr(x)`` and ``isinstance(x, cls)`` will look like the proxied object. Use ``issubclass(type(x), LocalProxy)`` to check if an object is a proxy. .. code-block:: python repr(user) # isinstance(user, User) # True issubclass(type(user), LocalProxy) # True :param local: The :class:`Local` or callable that provides the proxied object. :param name: The attribute name to look up on a :class:`Local`. Not used if a callable is given. .. versionchanged:: 2.0 Updated proxied attributes and methods to reflect the current data model. .. versionchanged:: 0.6.1 The class can be instantiated with a callable. __local__name __wrapped__Nr-)rr<r cCsBtj|d|tj|d|t|r>t|d r>tj|d|dS)N_LocalProxy__local_LocalProxy__namer r)r1r2callablerr)r"rr<rrrr#"szLocalProxy.__init__)r c CsRt|jds|jSyt|j|jStk rL|j}td|dYnXdS)zReturn the current object. This is useful if you want the real object behind the proxy at a time for performance reasons or because you want to pass the object into a different context. r zno object bound to N)rrrrPrr>rK)r"r<rrrru/s zLocalProxy._get_current_objectcCs t|jS)N)rfr')r"rrr>szLocalProxy.T)rnrlrmcCsdt|jdS)Nrdz unbound>)rfr)r"rrrrBs)rlcCsdS)NFr)r"rrrrNscCsgS)Nr)r"rrrrSscCst|S)N)rf)r"rrrr_s)rlrmcCs t||S)N)rY)r"rzrrrrascCs t||S)N) issubclass)r"rzrrrrbscOs |||S)Nr)r"rvrwrrrrds)rrr)N)rrrr'rCr)rirEr+rhr(r#rurjreprrg__str__ra __bytes__ __format__operatorlt__lt__le__le__eq__eq__ne__ne__gt__gt__ge__ge__hash__hash__rx__bool__rPr@setattrr2delattrrBdir__dir__r}__instancecheck____subclasscheck__r;rT__len__ length_hint__length_hint__getitem __getitem__setitem __setitem__delitem __delitem__r6r8next__next__reversed __reversed__contains __contains__add__add__sub__sub__mul__mul__matmul __matmul__truediv __truediv__floordiv __floordiv__mod__mod__divmod __divmod__pow__pow__lshift __lshift__rshift __rshift__and___and__xor__xor__or___or__r__radd____rsub____rmul__ __rmatmul__ __rtruediv__ __rfloordiv____rmod__ __rdivmod____rpow__ __rlshift__ __rrshift____rand____rxor____ror__ryiadd__iadd__isub__isub__imul__imul__imatmul __imatmul__itruediv __itruediv__ ifloordiv __ifloordiv__imod__imod__ipow__ipow__ilshift __ilshift__irshift __irshift__iand__iand__ixor__ixor__ior__ior__neg__neg__pos__pos__abs__abs__invert __invert__complex __complex__rF__int__float __float__index __index__round __round__mathtrunc __trunc__floor __floor__ceil__ceil__ __enter____exit__ __await__ __aiter__ __anext__Z __aenter__Z __aexit__rA__copy__deepcopy __deepcopy__rrrrr9s,"                                                   r9)r-r.)/rAr rsysZtypingr)r functoolsrrZwsgirZ TYPE_CHECKINGZ_typeshed.wsgirrrZTypeVarrEr+r Zgreenletr r ImportErrorrr rF ExceptionrrrmodulesrPZgreenlet_patchedZ gevent.monkeyrr rir/r-r.rVrjryrr9rrrrsX          AQtZ