ok

Mini Shell

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

3

,�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}tj|�s6t|t�s2t|d��dS|dk	r^|jt�sRt|d��t||�nt}t	�}|j
||||�dS)z@ Mark 'interface' as a named utilty providing 'iface_type'.
    z%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.6/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)zInterfaces search
    cSsg|]}|d�qS)�r)�.0�
iface_utilrrr�
<listcomp>@sz#searchInterface.<locals>.<listcomp>)�searchInterfaceUtilities)r�
search_string�baserrr�searchInterface=sr!cCsdd�t|||�D�S)zInterfaces search
    cSsg|]}|d�qS)rr)rrrrrrGsz&searchInterfaceIds.<locals>.<listcomp>)r)rrr rrr�searchInterfaceIdsDsr"csXt�}|jt�}�r.�j���fdd�|D�}�rF�fdd�|D�}ndd�|D�}|S)Ncs&g|]}t|d�j��dkr|�qS)rr)�getInterfaceAllDocs�find)rr)rrrrQsz,searchInterfaceUtilities.<locals>.<listcomp>csg|]}|dj��r|�qS)r)ZisOrExtends)rr)r rrrUscSsg|]}|�qSrr)rrrrrrXs)rZgetUtilitiesForr�lower)rrr rZiface_utilities�resr)r rrrKs
rcCsjd|j|jf}t|�j�t|j�j�g}tj|�r`x*t|�D]}|jt|j	|�j�j��q>Wdj
|�S)Nz%s.%s�
)r	r
�strr%�__doc__rr�sorted�appendZgetDescriptionFor�join)rZiface_idZdocs�namerrrr#\s

r#cCs|dkrdSt||�}|S)N�None)r)rrrrrr�nameToInterfaceis
r/cs^�dkrdSt|�d�}�fdd�|D�}|s>�jd�jSt|�dksVtd|��|dS)	Nr.)r cs$g|]}|�krd|j|jf�qS)z%s.%s)r	r
)rr)rrrrusz#interfaceToName.<locals>.<listcomp>�.rzAmbiguous interface names: %sr)r!r	r
�len�AssertionError)rr�itemsZidsr)rr�interfaceToNameos
r4)Nr)N)NN)NN)NN)r)Zzope.interfacerZzope.interface.interfacesrZzope.component.globalregistryrZzope.component.interfacesrZzope.component._apirZzope.component._compatrrrrr!r"rr#r/r4rrrr�<module>s
	






Zerion Mini Shell 1.0