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__/_api.cpython-39.pyc
a

,�WN#�@s�dZddlZddlZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lmZddl
mZddlmZdd
lmZddlmZzddlmZWney�ddlmZYn0daed9dd��Zdd�Zd:dd�Zeedfdd�Zeeddfdd�Zeedfdd�Zeeddfdd�Zd;dd�Zd<d d!�Z d"d#�Z!ed=d%d&��Z"ddl#Z$e$j%j%j&�'e"�d>d'd(�Z(d?d)d*�Z)d@d+d,�Z*dAd-d.�Z+e,�Z-dBd/d0�Z.dCd1d2�Z/d3d4�Z0dDd5d6�Z1dEd7d8�Z2dS)FzZope 3 Component Architecture
�N)�	Interface)�
implementedBy)�
providedBy)�IComponentArchitecture)�!IComponentRegistrationConvenience)�IFactory)�ComponentLookupError)�IComponentLookup)�_BLANK)�	adaptedBy)�adapter)�adapts)�hookablec
Cs^|dur tdurddlmatSz
t|�WStyX}zt|j��WYd}~n
d}~00dS)z! See IComponentArchitecture.
    Nr)�base)rZzope.component.globalregistryr	�	TypeErrorr�args)�context�error�r�5/usr/lib/python3/dist-packages/zope/component/_api.py�getSiteManager,s
rcCs"t|||�}|durt||��|S�N)�queryAdapterInContextr)�object�	interfacerrrrr�getAdapterInContext?s
rcCsvt|dd�}|durTz||�}Wn&tyFt��djdurB�Yn0|durT|S|�|�rb|St|��||d|�S)NZ__conform__��)�getattrr�sys�exc_info�tb_nextrr�queryAdapter)rrr�defaultZconformrrrrrEs
rcCs(t|||d|�}|dur$t|||��|Sr)r"r)rr�namerrrrr�
getAdapter`sr%cCs*|durt||||�St|��||||�Sr)�adapter_hookrr")rrr$r#rrrrr"fs
�r"cCs(t||||d�}|dur$t|||��|S�N)r)�queryMultiAdapterr)�objectsrr$rrrrr�getMultiAdaptermsr*cCs4zt|�}Wnty"|YS0|�||||�Sr)rrr()r)rr$r#r�sitemanagerrrrr(ss

r(cCs0zt|�}Wnty"gYS0|�||�Sr)rr�getAdapters)r)Zprovidedrr+rrrr,}s

r,cCs0zt|�}Wnty"gYS0|�||�Sr)rr�subscribers)r)rrr+rrrr-�s

r-cGstd��|d�dSr)rr-)r)rrr�handle�sr.rcCs0z
t�}WntyYdS0|�||||�Sr)rrr")rrr$r#r+rrrr&�s

r&cCs(t|||d�}|dur|St||��dSr')�queryUtilityr)rr$rZutilityrrr�
getUtility�sr0cCst|��|||�Sr)rr/)rr$r#rrrrr/�sr/cCst|��|�Sr)r�getUtilitiesFor�rrrrrr1�sr1cCst|��|�Sr)r�getAllUtilitiesRegisteredForr2rrrr3�sr3cCsVzt|�}Wnty"|YS0|j}|D]"}|�||t�}|tur.|Sq.|S)z�Query for the next available utility.

    Find the next available utility providing `interface` and having the
    specified name. If no utility was found, return the specified `default`
    value.
    )rr�	__bases__r/�_marker)rrr$r#Zsm�basesr�utilrrr�queryNextUtility�s

r8cCs0t|||t�}|tur,tjj�d||f��|S)zfGet the next available utility.

    If no utility was found, a `ComponentLookupError` is raised.
    z/No more utilities for %s, '%s' have been found.)r8r5�zopeZ	component�
interfacesr)rrr$r7rrr�getNextUtility�s��r;cOs"|�dd�}tt||�|i|��S)zkInvoke the named factory and return the result.

    ``__factory_name`` is a positional-only argument.
    rN)�popr0r)Z__factory_namer�kwargsrrrr�createObject�sr>cCstt||���S)znReturn the interface provided by the named factory's objects

    Result might be a single interface. XXX
    )r0r�
getInterfaces)r$rrrr�getFactoryInterfaces�sr@c	csvt|�}|�t�D]^\}}|��}z|�|�r8||fVWqtyn|D]}|�|�rL||fVqjqLYq0qdS)zCReturn info on all factories implementing the given interface.
    N)rr1rr?ZisOrExtends�AttributeError)rrZutilsr$�factoryr:Zifacerrr�getFactoriesFor�s


rC)N)N)N)N)rN)rN)rNN)N)N)rN)r)N)N)3�__doc__r�typesZzope.interfacerrrZzope.component.interfacesrrrrr	Zzope.component._compatr
Zzope.component._declarationrrr
Z
zope.hookabler�ImportErrorZzope.component.hookablerrrrr%r"r*r(r,r-r.r&Zzope.interface.interfacer9rZ
adapter_hooks�appendr0r/r1r3rr5r8r;r>r@rCrrrr�<module>s`
�
�