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

,�W��@s�dZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZdd
d�Z
dd
�Zddd�Zddd�Zddd�Zd dd�Zdd�Zdd�Zdd�ZdS)!zInterface utility functions
�)�alsoProvides)�
IInterface)�getGlobalSiteManager)�ComponentLookupError)�queryUtility)�CLASS_TYPESN�cCs||sd|j|jf}t�|�s6t|t�s2t|d��dS|dur^|�t�sRt|d��t||�nt}t	�}|�
||||�dS)z@ Mark 'interface' as a named utilty providing 'iface_type'.
    �%s.%szis not an interface or classNzis not an interface type)�
__module__�__name__r�
providedBy�
isinstancer�	TypeErrorZextendsrrZregisterUtility)�id�	interfaceZ
iface_type�info�gsm�r�:/usr/lib/python3/dist-packages/zope/component/interface.py�provideInterfaces




rcCst|d�}|durt|��|S)z3Return interface or raise ComponentLookupError
    N)�queryInterfacer��contextr�ifacerrr�getInterface.s
rcCstt||�S)z$Return an interface or ``None``
    )rr)r�defaultrrrr7srcCsdd�t|||�D�S)�Interfaces search
    cSsg|]}|d�qS��r��.0Z
iface_utilrrr�
<listcomp>@�z#searchInterface.<locals>.<listcomp>��searchInterfaceUtilities�r�
search_string�baserrr�searchInterface=s
�r(cCsdd�t|||�D�S)rcSsg|]}|d�qS)rrrrrrr!Gr"z&searchInterfaceIds.<locals>.<listcomp>r#r%rrr�searchInterfaceIdsDs
�r)csXt�}|�t�}�r.�����fdd�|D�}�rF�fdd�|D�}ndd�|D�}|S)Ncs&g|]}t|d����dkr|�qS)rr)�getInterfaceAllDocs�findr)r&rrr!Qs���z,searchInterfaceUtilities.<locals>.<listcomp>csg|]}|d���r|�qSr)ZisOrExtendsr�r'rrr!Us�cSsg|]}|�qSrrrrrrr!Xr")rZgetUtilitiesForr�lower)rr&r'rZiface_utilities�resr)r'r&rr$Ks
r$cCsfd|j|jf}t|���t|j���g}t�|�r\t|�D]}|�t|�	|�j����q<d�
|�S)Nr	�
)r
r�strr-�__doc__rr�sorted�appendZgetDescriptionFor�join)rZiface_idZdocs�namerrrr*\s
�
�r*cCs|dkrdSt||�}|S)N�None)rrrrr�nameToInterfaceis
r7cs^�durdSt|�d�}�fdd�|D�}|s>�jd�jSt|�dksVJd|��|dS)	Nr6r,cs$g|]}|�krd|j|jf�qS)r	)r
r)r r�rrrr!us�z#interfaceToName.<locals>.<listcomp>�.rzAmbiguous interface names: %sr)r(r
r�len)rr�itemsZidsrr8r�interfaceToNameos
�r<)Nr)N)NN)NN)NN)r1Zzope.interfacerZzope.interface.interfacesrZzope.component.globalregistryrZzope.component.interfacesrZzope.component._apirZzope.component._compatrrrrr(r)r$r*r7r<rrrr�<module>s