HEX
Server: Apache
System: Linux srv1.prosuiteplus.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: prosuiteplus (1001)
PHP: 8.3.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/zope/component/__pycache__/interface.cpython-38.pyc
U

,�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|dk	r^|�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�}|dkrt|��|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>@sz#searchInterface.<locals>.<listcomp>��searchInterfaceUtilities�r�
search_string�baserrr�searchInterface=s
�r'cCsdd�t|||�D�S)rcSsg|]}|d�qS)rrrrrrr!Gsz&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!Xs)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
r6cs^�dkrdSt|�d�}�fdd�|D�}|s>�jd�jSt|�dksVtd|��|dS)	Nr5r+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�AssertionError)rr�itemsZidsrr7r�interfaceToNameos
�r<)Nr)N)NN)NN)NN)r0Zzope.interfacerZzope.interface.interfacesrZzope.component.globalregistryrZzope.component.interfacesrZzope.component._apirZzope.component._compatrrrrr'r(r#r)r6r<rrrr�<module>s