ok

Mini Shell

Direktori : /lib/python3.6/site-packages/zope/component/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/zope/component/__pycache__/hooks.cpython-36.pyc

3

,�W��@sdZdZddlZddlZyddlmZWnek
rDdd�ZYnXddlmZddl	m
Z
dd	l	mZGd
d�de�Z
Gdd
�d
ej�Ze�Zddd�Zdd�Zejdd��Zddd�Zd dd�Zdd�Zdd�ZeZyddlmZWnek
�rYn
Xee�dS)!zEHooks for getting and setting a site in the thread global namespace.
Zrestructuredtext�N)�removeSecurityProxycCs|S)N�)�xrr�/usr/lib/python3.6/hooks.pyrsr)�getGlobalSiteManager)�ComponentLookupError)�IComponentLookupc@s eZdZdZdd�Zdd�ZdS)�
read_propertyz�Descriptor for property-like computed attributes.

    Unlike the standard 'property', this descriptor allows assigning a
    value to the instance, shadowing the property getter function.
    cCs
||_dS)N)�func)�selfr
rrr�__init__&szread_property.__init__cCs|dkr|S|j|�S)N)r
)rZinst�clsrrr�__get__)szread_property.__get__N)�__name__�
__module__�__qualname__�__doc__rrrrrrr	 sr	c@s"eZdZdZe�Zedd��ZdS)�SiteInfoNcCs|jjj}||_|S)N)�smZadapters�adapter_hook)rrrrrr3s
zSiteInfo.adapter_hook)rrr�siterrr	rrrrrr/srcCsN|dkrt�}nt|�}|j�}|t_|t_yt`Wntk
rHYnXdS)N)rr�getSiteManager�siteinforrr�AttributeError)rrrrr�setSite;s
rcCstjS)N)rrrrrr�getSiteRsrccs(t�}t|�z
dVWdt|�XdS)N)rr)rZold_siterrrrVs

rcCs&|dkrtjSt|t��}t|�}|S)z�A special hook for getting the site manager.

    Here we take the currently set site into account to find the appropriate
    site manager.
    N)rrrrr)�contextrrrrr`s
r�cCs*ytj||||�Stk
r$|SXdS)N)rrr)Z	interface�object�name�defaultrrrrusrcCs(ddlm}|jjt�|jjt�dS)Nr)�_api)�zope.componentr!rZsethookr)r!rrr�setHooks|sr#cCsBddlm}|jj�|jj�yt`Wntk
r<YnXdS)Nr)r!)r"r!r�resetrrr)r!rrr�
resetHooks�s

r%)�
addCleanUp)N)N)rN)rZ
__docformat__�
contextlibZ	threadingZzope.security.proxyr�ImportErrorZzope.component.globalregistryrZzope.component.interfacesrrrr	Zlocalrrrr�contextmanagerrrrr#r%Z	clearSiteZzope.testing.cleanupr&rrrr�<module>s4







Zerion Mini Shell 1.0