HEX
Server: Apache/2.4.65 (Debian)
System: Linux kubikelcreative 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User: www-data (33)
PHP: 8.4.13
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/zope/component/__pycache__/hooks.cpython-39.pyc
a

,�W��@s
dZdZddlZddlZzddlmZWneyBdd�ZYn0ddlmZddl	m
Z
dd	l	mZGd
d�de�Z
Gdd
�d
ej�Ze�Zddd�Zdd�Zejdd��Zddd�Zd dd�Zdd�Zdd�ZeZzddlmZWne�y�Yn
0ee�dS)!zEHooks for getting and setting a site in the thread global namespace.
Zrestructuredtext�N)�removeSecurityProxycCs|S�N�)�xrr�6/usr/lib/python3/dist-packages/zope/component/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
||_dSr��func)�selfrrrr�__init__&szread_property.__init__cCs|dur|S|�|�Srr)r
�inst�clsrrr�__get__)szread_property.__get__N)�__name__�
__module__�__qualname__�__doc__rrrrrrr
 sr
c@s"eZdZdZe�Zedd��ZdS)�SiteInfoNcCs|jjj}||_|Sr)�smZadapters�adapter_hook)r
rrrrr3s
zSiteInfo.adapter_hook)rrr�siterrr
rrrrrr/srcCsL|durt�}nt|�}|��}|t_|t_zt`WntyFYn0dSr)rr�getSiteManager�siteinforrr�AttributeError)rrrrr�setSite;s
rcCstjSr)rrrrrr�getSiteRsrccs0t�}t|�zdVWt|�n
t|�0dSr)rr)rZold_siterrrrVs
rcCs&|durtjSt|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)rrr	rr)�contextrrrrr`s�r�cCs.zt�||||�WSty(|YS0dSr)rrr)Z	interface�object�name�defaultrrrrusrcCs(ddlm}|j�t�|j�t�dS�Nr��_api)�zope.componentr&rZsethookrr%rrr�setHooks|sr(cCs@ddlm}|j��|j��zt`Wnty:Yn0dSr$)r'r&r�resetrrrr%rrr�
resetHooks�s

r*)�
addCleanUp)N)N)r N)rZ
__docformat__�
contextlibZ	threadingZzope.security.proxyr�ImportErrorZzope.component.globalregistryrZzope.component.interfacesrr	r!r
Zlocalrrrr�contextmanagerrrrr(r*Z	clearSiteZzope.testing.cleanupr+rrrr�<module>s6