U
    ˆjÔd  ã                   @   s²  d Z ddlmZ zddlmZ W n ek
r<   dd„ ZY nX ddlmZ ddlm	Z	 ddlm
Z
 dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dgZG dd„ dƒZdd„ ZG dd„ dƒZe
eƒG dd„ dƒƒZdd„ Zdd „ Zd!d"„ Z d#d$„ Z!e
eƒG d%d&„ d&ƒƒZ"e
eƒG d'd(„ d(ƒƒZ#eeƒG d)d*„ d*e#ƒƒZ$eeƒG d+d,„ d,e#ƒƒZ%d-S ).zBasic components support
é    )Údefaultdict)Únotifyc                  O   s   d S ©N© )ÚargÚkwr   r   ú;/tmp/pip-unpacked-wheel-1_n45v_5/zope/interface/registry.pyr      s    r   )ÚAdapterRegistry)ÚimplementedBy)Úimplementer)Úimplementer_only)Ú
providedBy)Ú	Interface)ÚComponentLookupError)ÚIAdapterRegistration)ÚIComponents)ÚIHandlerRegistration)ÚISpecification)Ú ISubscriptionAdapterRegistration)ÚIUtilityRegistration)Ú
Registered)ÚUnregisteredÚ
Componentsc                   @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
Ú_UnhashableComponentCounterc                 C   s   dd„ |  ¡ D ƒ| _d S )Nc                 S   s   g | ]}|‘qS r   r   )Ú.0Úitemr   r   r   Ú
<listcomp>7   s     z8_UnhashableComponentCounter.__init__.<locals>.<listcomp>)ÚitemsÚ_data)ÚselfZ	otherdictr   r   r   Ú__init__5   s    z$_UnhashableComponentCounter.__init__c                 C   s$   | j D ]\}}||kr|  S qdS ©Nr   )r   )r   ÚkeyÚ	componentÚcountr   r   r   Ú__getitem__9   s    
z'_UnhashableComponentCounter.__getitem__c                 C   sH   t | jƒD ](\}}|d |kr
||f| j|<  d S q
| j ||f¡ d S r!   )Ú	enumerater   Úappend)r   r#   r$   ÚiÚdatar   r   r   Ú__setitem__?   s
    z'_UnhashableComponentCounter.__setitem__c                 C   s:   t | jƒD ]"\}}|d |kr
| j|=  d S q
t|ƒ‚d S r!   )r&   r   ÚKeyError)r   r#   r(   r)   r   r   r   Ú__delitem__F   s
    z'_UnhashableComponentCounter.__delitem__N)Ú__name__Ú
__module__Ú__qualname__r    r%   r*   r,   r   r   r   r   r   2   s   r   c                   C   s   t tƒS r   )r   Úintr   r   r   r   Ú_defaultdict_intN   s    r1   c                   @   sD   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dS )Ú_UtilityRegistrationsc                 C   s"   t tƒ| _|| _|| _|  ¡  d S r   )r   r1   Ú_cacheÚ
_utilitiesÚ_utility_registrationsÚ%_UtilityRegistrations__populate_cache)r   Ú	utilitiesZutility_registrationsr   r   r   r    T   s    
z_UtilityRegistrations.__init__c                 C   s4   t | j ¡ ƒD ] \\}}}|d }|  ||¡ qd S r!   )Úiterr5   r   Ú$_UtilityRegistrations__cache_utility)r   ÚpÚ_r)   r#   r   r   r   Z__populate_cache\   s    z&_UtilityRegistrations.__populate_cachec                 C   s\   z| j | |  d7  < W n< tk
rV   t| j | ƒ }| j |< ||  d7  < Y nX d S )Né   )r3   Ú	TypeErrorr   )r   Úprovidedr#   Zprovr   r   r   Z__cache_utilitya   s    ÿz%_UtilityRegistrations.__cache_utilityc                 C   s:   | j | }|| }|d8 }|dkr*||= n|||< |dkS )Nr<   r   )r3   )r   r>   r#   r$   r   r   r   Z__uncache_utilityl   s    
z'_UtilityRegistrations.__uncache_utilityc                 C   s0   z| j | | dkW S  tk
r*   Y dS X d S )Nr   F)r3   r=   )r   r>   r#   r   r   r   Ú_is_utility_subscribed{   s    z,_UtilityRegistrations._is_utility_subscribedc                 C   sV   |   ||¡}|||f| j||f< | j d|||¡ |sF| j d||¡ |  ||¡ d S ©Nr   )r?   r5   r4   ÚregisterÚ	subscriber9   )r   r>   Únamer#   ÚinfoÚfactoryÚ
subscribedr   r   r   ÚregisterUtility‚   s    þÿz%_UtilityRegistrations.registerUtilityc                 C   s@   | j ||f= | j d||¡ |  ||¡}|s<| j d||¡ d S r@   )r5   r4   Ú
unregisterÚ&_UtilityRegistrations__uncache_utilityÚunsubscribe)r   r>   rC   r#   rF   r   r   r   ÚunregisterUtility�   s
    z'_UtilityRegistrations.unregisterUtilityN)
r-   r.   r/   r    r6   r9   rI   r?   rG   rK   r   r   r   r   r2   R   s   r2   c                       sN  e Zd ZdZdIdd„Zdd„ Z‡ fdd	„Zd
d„ Zdd„ Ze	dd„ ƒZ
dd„ Zdd„ Ze	dd„ dd„ ƒZdJdd„ZdKdd„Zdd„ ZdLdd„ZdMd d!„Zd"d#„ Zd$d%„ ZdNd&d'„ZdOd(d)„Zd*d+„ ZdPd,d-„ZdQd.d/„ZdRd0d1„ZdSd2d3„Zd4d5„ ZdTd6d7„Zd8d9„ ZdUd:d;„Zd<d=„ Z dVd>d?„Z!d@dA„ Z"dWdBdC„Z#dDdE„ Z$dXdGdH„Z%‡  Z&S )Yr   NÚ r   c                 C   s8   t |tƒst‚|| _|  ¡  |  ¡  t|ƒ| _d | _d S r   )	Ú
isinstanceÚstrÚAssertionErrorr-   Ú_init_registriesÚ_init_registrationsÚtupleÚ	__bases__Ú_v_utility_registrations_cache)r   rC   Úbasesr   r   r   r    ž   s    
zComponents.__init__c                 C   s   d| j j› d| j› d�S )Nú<ú ú>)Ú	__class__r-   ©r   r   r   r   Ú__repr__¨   s    zComponents.__repr__c                    s8   t ƒ  ¡ }dd„ |d  ¡ D ƒ}t|ƒ}||d< t|ƒS )Nc                 S   s    i | ]\}}|  d ¡s||“qS )Z_v_)Ú
startswith)r   ÚkÚvr   r   r   Ú
<dictcomp>´   s    
ÿ z)Components.__reduce__.<locals>.<dictcomp>é   )ÚsuperÚ
__reduce__r   ÚlistrR   )r   Z	reductionZfiltered_state©rY   r   r   rb   «   s
    
zComponents.__reduce__c                 C   s   t ƒ | _t ƒ | _d S r   )r	   Úadaptersr7   rZ   r   r   r   rP   º   s    zComponents._init_registriesc                 C   s   i | _ i | _g | _g | _d S r   )r5   Ú_adapter_registrationsÚ_subscription_registrationsÚ_handler_registrationsrZ   r   r   r   rQ   À   s    zComponents._init_registrationsc                 C   s>   | j }|d ks&|j| jk	s&|j| jk	r:t| j| jƒ }| _ |S r   )rT   r4   r7   r5   r2   )r   Úcacher   r   r   Ú_utility_registrations_cacheÆ   s    ÿ
þ
ý ÿÿz'Components._utility_registrations_cachec                 C   s   | j  dd¡S )NrS   r   )Ú__dict__ÚgetrZ   r   r   r   Ú	_getBases×   s    zComponents._getBasesc                 C   s>   t dd„ |D ƒƒ| j_t dd„ |D ƒƒ| j_t |ƒ| jd< d S )Nc                 S   s   g | ]
}|j ‘qS r   )re   ©r   Úbaser   r   r   r   Ý   s    z(Components._setBases.<locals>.<listcomp>c                 S   s   g | ]
}|j ‘qS r   )r7   rn   r   r   r   r   ß   s    rS   )rR   re   rS   r7   rk   ©r   rU   r   r   r   Ú	_setBasesÛ   s    ÿÿzComponents._setBasesc                 C   s   |   ¡ S r   )rm   rZ   r   r   r   Ú<lambda>ä   ó    zComponents.<lambda>c                 C   s
   |   |¡S r   )rq   rp   r   r   r   rr   å   rs   Tc              	   C   s®   |r|rt dƒ‚|ƒ }|d kr&t|ƒ}|dkr6t|ƒ}| j ||f¡}|d k	rx|d d… ||fkrfd S |  |d ||¡ | j |||||¡ |rªtt	t
| |||||ƒƒƒ d S )Nú$Can't specify factory and component.rL   r`   r   )r=   Ú_getUtilityProvidedÚ_getNamer5   rl   rK   rj   rG   r   r   ÚUtilityRegistration)r   r#   r>   rC   rD   ÚeventrE   Úregr   r   r   rG   è   s>        ÿ     ÿÿzComponents.registerUtilityc                 C   s®   |r|rt dƒ‚|ƒ }|d kr6|d kr.t dƒ‚t|ƒ}| j ||f¡}|d ksb|d k	rf||d krfdS |d krv|d }| j |||¡ ttt| |||f|dd … žŽ ƒƒ dS )Nrt   z3Must specify one of component, factory and providedr   Fr<   T)	r=   ru   r5   rl   rj   rK   r   r   rw   )r   r#   r>   rC   rE   Úoldr   r   r   rK     s0    
ÿ  ÿÿzComponents.unregisterUtilityc                 c   s4   t | j ¡ ƒD ] \\}}}t| ||f|žŽ V  qd S r   )r8   r5   r   rw   )r   r>   rC   r)   r   r   r   ÚregisteredUtilities$  s    ÿzComponents.registeredUtilitiesc                 C   s   | j  d|||¡S r@   )r7   Úlookup)r   r>   rC   Údefaultr   r   r   ÚqueryUtility)  s    zComponents.queryUtilityc                 C   s&   | j  d||¡}|d kr"t||ƒ‚|S r@   )r7   r|   r   )r   r>   rC   Zutilityr   r   r   Ú
getUtility,  s    
zComponents.getUtilityc                 c   s   | j  d|¡E d H  d S r@   )r7   Ú	lookupAll©r   Ú	interfacer   r   r   ÚgetUtilitiesFor2  s    zComponents.getUtilitiesForc                 C   s   | j  d|¡S r@   )r7   Zsubscriptionsr�   r   r   r   ÚgetAllUtilitiesRegisteredFor5  s    z'Components.getAllUtilitiesRegisteredForc              	   C   sr   |d krt |ƒ}t||ƒ}|dkr*t|ƒ}||f| j|||f< | j ||||¡ |rnttt| |||||ƒƒƒ d S ©NrL   )	Ú_getAdapterProvidedÚ_getAdapterRequiredrv   rf   re   rA   r   r   ÚAdapterRegistration©r   rE   Úrequiredr>   rC   rD   rx   r   r   r   ÚregisterAdapter8  s&    
ÿ     ÿÿzComponents.registerAdapterc                 C   s²   |d kr |d krt dƒ‚t|ƒ}|d kr8|d kr8t dƒ‚t||ƒ}| j |||f¡}|d ksp|d k	rt||d krtdS | j|||f= | j |||¡ ttt	| |||f|žŽ ƒƒ dS )Nú(Must specify one of factory and providedú(Must specify one of factory and requiredr   FT)
r=   r†   r‡   rf   rl   re   rH   r   r   rˆ   )r   rE   rŠ   r>   rC   rz   r   r   r   ÚunregisterAdapterJ  s$    

ÿÿzComponents.unregisterAdapterc                 c   s:   t | j ¡ ƒD ]&\\}}}\}}t| |||||ƒV  qd S r   )r8   rf   r   rˆ   )r   rŠ   r>   rC   r#   rD   r   r   r   ÚregisteredAdaptersd  s    ÿ
 ÿzComponents.registeredAdaptersc                 C   s   | j  ||||¡S r   )re   ÚqueryAdapter)r   Úobjectr‚   rC   r}   r   r   r   r�   j  s    zComponents.queryAdapterc                 C   s(   | j  |||¡}|d kr$t|||ƒ‚|S r   )re   r�   r   )r   r‘   r‚   rC   Úadapterr   r   r   Ú
getAdapterm  s    zComponents.getAdapterc                 C   s   | j  ||||¡S r   )re   ÚqueryMultiAdapter)r   Úobjectsr‚   rC   r}   r   r   r   r”   s  s       ÿzComponents.queryMultiAdapterc                 C   s(   | j  |||¡}|d kr$t|||ƒ‚|S r   )re   r”   r   )r   r•   r‚   rC   r’   r   r   r   ÚgetMultiAdapterx  s    zComponents.getMultiAdapterc                 c   s@   | j  ttt|ƒƒ|¡D ]"\}}||Ž }|d k	r||fV  qd S r   )re   r€   rc   Úmapr   )r   r•   r>   rC   rE   r’   r   r   r   ÚgetAdapters~  s     ÿzComponents.getAdaptersc              	   C   sn   |rt dƒ‚|d krt|ƒ}t||ƒ}| j |||||f¡ | j |||¡ |rjttt	| |||||ƒƒƒ d S )Nú'Named subscribers are not yet supported)
r=   r†   r‡   rg   r'   re   rB   r   r   ÚSubscriptionRegistrationr‰   r   r   r   ÚregisterSubscriptionAdapter†  s(    
ÿ     ÿÿz&Components.registerSubscriptionAdapterc                 c   s    | j D ]}t| f|žŽ V  qd S r   )rg   rš   ©r   r)   r   r   r   ÚregisteredSubscriptionAdapters›  s    
z)Components.registeredSubscriptionAdaptersc              	      sØ   |rt dƒ‚ˆd kr,ˆ d kr$t dƒ‚tˆ ƒ‰ˆd krDˆ d krDt dƒ‚tˆ ˆƒ‰ˆ d krn‡‡fdd„| jD ƒ}n‡ ‡‡fdd„| jD ƒ}t|ƒt| jƒkrœdS || jd d …< | j ˆˆˆ ¡ ttt	| ˆˆ|ˆ dƒƒƒ d	S )
Nr™   rŒ   r�   c                    s4   g | ],\}}}}}|ˆkr"|ˆ ks|||||f‘qS r   r   ©r   Úrr:   ÚnÚfr(   )r>   rŠ   r   r   r   ¯  s    ýz<Components.unregisterSubscriptionAdapter.<locals>.<listcomp>c                    s<   g | ]4\}}}}}|ˆkr*|ˆkr*|ˆ ks|||||f‘qS r   r   rž   ©rE   r>   rŠ   r   r   r   µ  s
     ýFrL   T)
r=   r†   r‡   rg   Úlenre   rJ   r   r   rš   )r   rE   rŠ   r>   rC   Únewr   r¢   r   ÚunregisterSubscriptionAdapterŸ  s>    
þþ     ÿÿz(Components.unregisterSubscriptionAdapterc                 C   s   | j  ||¡S r   ©re   Úsubscribers)r   r•   r>   r   r   r   r§   É  s    zComponents.subscribersc                 C   sZ   |rt dƒ‚t||ƒ}| j ||||f¡ | j |d |¡ |rVttt| ||||ƒƒƒ d S )Nz$Named handlers are not yet supported)	r=   r‡   rh   r'   re   rB   r   r   ÚHandlerRegistration)r   rE   rŠ   rC   rD   rx   r   r   r   ÚregisterHandlerÌ  s    

ÿÿzComponents.registerHandlerc                 c   s    | j D ]}t| f|žŽ V  qd S r   )rh   r¨   rœ   r   r   r   ÚregisteredHandlersÝ  s    
zComponents.registeredHandlersc                    s²   |rt dƒ‚ˆd kr$ˆ d kr$t dƒ‚tˆ ˆƒ‰ˆ d krL‡fdd„| jD ƒ}n‡ ‡fdd„| jD ƒ}t|ƒt| jƒkrxdS || jd d …< | j ˆd ˆ ¡ ttt| ˆ|ˆ dƒƒƒ dS )	Nr™   r�   c                    s(   g | ] \}}}}|ˆ kr||||f‘qS r   r   ©r   rŸ   r    r¡   r(   )rŠ   r   r   r   ë  s   
ýz0Components.unregisterHandler.<locals>.<listcomp>c                    s0   g | ](\}}}}|ˆkr |ˆ ks||||f‘qS r   r   r«   ©rE   rŠ   r   r   r   ñ  s   
 ýFrL   T)	r=   r‡   rh   r£   re   rJ   r   r   r¨   )r   rE   rŠ   rC   r¤   r   r¬   r   ÚunregisterHandlerá  s(    

þþÿzComponents.unregisterHandlerc                 G   s   | j  |d ¡ d S r   r¦   )r   r•   r   r   r   Úhandle  s    zComponents.handleFc              	   C   s  t | jƒ}| j}d}d}d}d}d|jks.t‚dd„ |_|rJ|j}|j}	ndd„  }}	z‚| ¡ D ]t\\}
}\}}}| 	d|
|¡|krœ|d|
||ƒ |d7 }n|d7 }| 
d|
|¡dkrÌ|d7 }|	d|
|ƒ q`|d7 }q`W 5 |`|rô|sê|rô| |¡ X ||||d	œS )
aì  
        Emergency maintenance method to rebuild the ``.utilities``
        registry from the local copy maintained in this object, or
        detect the need to do so.

        Most users will never need to call this, but it can be helpful
        in the event of suspected corruption.

        By default, this method only checks for corruption. To make it
        actually rebuild the registry, pass `True` for *rebuild*.

        :param bool rebuild: If set to `True` (not the default),
           this method will actually register and subscribe utilities
           in the registry as needed to synchronize with the local cache.

        :return: A dictionary that's meant as diagnostic data. The keys
           and values may change over time. When called with a false
           *rebuild*, the keys ``"needed_registered"`` and
           ``"needed_subscribed"`` will be non-zero if any corruption was
           detected, but that will not be corrected.

        .. versionadded:: 5.3.0
        r   Úchangedc                 S   s   d S r   r   )r;   r   r   r   rr   (  rs   zAComponents.rebuildUtilityRegistryFromLocalCache.<locals>.<lambda>c                  W   s   d S r   r   )Úargsr   r   r   rr   .  rs   r   r<   N)Úneeded_registeredÚdid_not_registerÚneeded_subscribedÚdid_not_subscribe)Údictr5   r7   rk   rO   r¯   rA   rB   r   Z
registeredrF   )r   ZrebuildÚregsÚutilsr±   r²   r³   r´   rA   rB   r>   rC   ÚvalueÚ_infoÚ_factoryr   r   r   Ú$rebuildUtilityRegistryFromLocalCache  s<    


üz/Components.rebuildUtilityRegistryFromLocalCache)rL   r   )NNrL   rL   TN)NNrL   N)rL   N)rL   )NNrL   rL   T)NNNrL   )rL   N)rL   )rL   N)rL   )NNrL   rL   T)NNNrL   )NrL   rL   T)NNrL   )F)'r-   r.   r/   rT   r    r[   rb   rP   rQ   Úpropertyrj   rm   rq   rS   rG   rK   r{   r~   r   rƒ   r„   r‹   rŽ   r�   r�   r“   r”   r–   r˜   r›   r�   r¥   r§   r©   rª   r­   r®   r»   Ú__classcell__r   r   rd   r   r   ™   s†   


þ      ÿ
  ÿ


      ÿ
      ÿ


  ÿ

	       ý
       ÿ
*     ý

"c                 C   s$   z| j W S  tk
r   Y dS X d S r…   )Z__component_name__ÚAttributeError)r#   r   r   r   rv   J  s    rv   c                 C   s,   t t| ƒƒ}t|ƒdkr |d S tdƒ‚d S )Nr<   r   zWThe utility doesn't provide a single interface and no provided interface was specified.)rc   r   r£   r=   )r#   r>   r   r   r   ru   Q  s    ÿru   c                 C   s,   t t| ƒƒ}t|ƒdkr |d S tdƒ‚d S )Nr<   r   zaThe adapter factory doesn't implement a single interface and no provided interface was specified.)rc   r
   r£   r=   )rE   r>   r   r   r   r†   [  s    ÿr†   c                 C   s    |d kr2z
| j }W qD tk
r.   tdƒ‚Y qDX nt |¡rDtdƒ‚g }|D ]J}|d kr^t}n.t |¡sŒt|tƒr|t|ƒ}ntdt|ƒ ƒ‚| 	|¡ qLt
|ƒS )NzoThe adapter factory doesn't have a __component_adapts__ attribute and no required specifications were specifiedzLthe required argument should be a list of interfaces, not a single interfacez?Required specification must be a specification or class, not %r)Z__component_adapts__r¾   r=   r   r   r   rM   Útyper
   r'   rR   )rE   rŠ   ÚresultrŸ   r   r   r   r‡   e  s2    
ÿ
ÿ


ÿÿr‡   c                   @   sV   e Zd Zddd„Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Zdd„ Z	dd„ Z
dd„ ZdS )rw   Nc                 C   s(   || _ || _|| _|| _|| _|| _d S r   )Úregistryr>   rC   r#   rD   rE   )r   rÁ   r>   rC   r#   ÚdocrE   r   r   r   r    ‡  s    zUtilityRegistration.__init__c                 C   s<   d  | jj| jt| jdd ƒ| jt| jdt| jƒƒ| j	| j
¡S )Nz"{}({!r}, {}, {!r}, {}, {!r}, {!r})r-   )ÚformatrY   r-   rÁ   Úgetattrr>   rC   r#   ÚreprrE   rD   rZ   r   r   r   r[   �  s      ûzUtilityRegistration.__repr__c                 C   s   t | ƒS r   ©ÚidrZ   r   r   r   Ú__hash__˜  s    zUtilityRegistration.__hash__c                 C   s   t | ƒt |ƒkS r   ©rÅ   ©r   Úotherr   r   r   Ú__eq__›  s    zUtilityRegistration.__eq__c                 C   s   t | ƒt |ƒkS r   rÉ   rÊ   r   r   r   Ú__ne__ž  s    zUtilityRegistration.__ne__c                 C   s   t | ƒt |ƒk S r   rÉ   rÊ   r   r   r   Ú__lt__¡  s    zUtilityRegistration.__lt__c                 C   s   t | ƒt |ƒkS r   rÉ   rÊ   r   r   r   Ú__le__¤  s    zUtilityRegistration.__le__c                 C   s   t | ƒt |ƒkS r   rÉ   rÊ   r   r   r   Ú__gt__§  s    zUtilityRegistration.__gt__c                 C   s   t | ƒt |ƒkS r   rÉ   rÊ   r   r   r   Ú__ge__ª  s    zUtilityRegistration.__ge__)N©r-   r.   r/   r    r[   rÈ   rÌ   rÍ   rÎ   rÏ   rÐ   rÑ   r   r   r   r   rw   „  s   
	rw   c                   @   sT   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dd„ ZdS )rˆ   c                 C   s,   ||||||f\| _ | _| _| _| _| _d S r   )rÁ   rŠ   r>   rC   rE   rD   )r   rÁ   rŠ   r>   rC   r#   rÂ   r   r   r   r    ±  s
    þ ÿzAdapterRegistration.__init__c                 C   sT   d  | jj| jdd dd„ | jD ƒ¡ d t| jdd ƒ| jt| j	dt
| j	ƒƒ| j¡S )Nz {}({!r}, {}, {}, {!r}, {}, {!r})ú[ú, c                 S   s   g | ]
}|j ‘qS r   ©r-   ©r   rŸ   r   r   r   r   º  s     z0AdapterRegistration.__repr__.<locals>.<listcomp>ú]r-   )rÃ   rY   r-   rÁ   ÚjoinrŠ   rÄ   r>   rC   rE   rÅ   rD   rZ   r   r   r   r[   ¶  s      ûzAdapterRegistration.__repr__c                 C   s   t | ƒS r   rÆ   rZ   r   r   r   rÈ   ¿  s    zAdapterRegistration.__hash__c                 C   s   t | ƒt |ƒkS r   rÉ   rÊ   r   r   r   rÌ   Â  s    zAdapterRegistration.__eq__c                 C   s   t | ƒt |ƒkS r   rÉ   rÊ   r   r   r   rÍ   Å  s    zAdapterRegistration.__ne__c                 C   s   t | ƒt |ƒk S r   rÉ   rÊ   r   r   r   rÎ   È  s    zAdapterRegistration.__lt__c                 C   s   t | ƒt |ƒkS r   rÉ   rÊ   r   r   r   rÏ   Ë  s    zAdapterRegistration.__le__c                 C   s   t | ƒt |ƒkS r   rÉ   rÊ   r   r   r   rÐ   Î  s    zAdapterRegistration.__gt__c                 C   s   t | ƒt |ƒkS r   rÉ   rÊ   r   r   r   rÑ   Ñ  s    zAdapterRegistration.__ge__NrÒ   r   r   r   r   rˆ   ®  s   	rˆ   c                   @   s   e Zd ZdS )rš   N)r-   r.   r/   r   r   r   r   rš   Õ  s   rš   c                   @   s,   e Zd Zdd„ Zedd„ ƒZdZdd„ ZdS )r¨   c                 C   s&   |||||f\| _ | _| _| _| _d S r   )rÁ   rŠ   rC   ÚhandlerrD   )r   rÁ   rŠ   rC   rÙ   rÂ   r   r   r   r    Ý  s    ÿzHandlerRegistration.__init__c                 C   s   | j S r   )rÙ   rZ   r   r   r   rE   á  s    zHandlerRegistration.factoryNc                 C   sH   d  | jj| jdd dd„ | jD ƒ¡ d | jt| jdt	| jƒƒ| j
¡S )Nz{}({!r}, {}, {!r}, {}, {!r})rÓ   rÔ   c                 S   s   g | ]
}|j ‘qS r   rÕ   rÖ   r   r   r   r   ë  s     z0HandlerRegistration.__repr__.<locals>.<listcomp>r×   r-   )rÃ   rY   r-   rÁ   rØ   rŠ   rC   rÄ   rE   rÅ   rD   rZ   r   r   r   r[   ç  s     ûzHandlerRegistration.__repr__)r-   r.   r/   r    r¼   rE   r>   r[   r   r   r   r   r¨   Ú  s
   
r¨   N)&Ú__doc__Úcollectionsr   Z
zope.eventr   ÚImportErrorZzope.interface.adapterr	   Zzope.interface.declarationsr
   r   r   r   Zzope.interface.interfacer   Zzope.interface.interfacesr   r   r   r   r   r   r   r   r   Ú__all__r   r1   r2   r   rv   ru   r†   r‡   rw   rˆ   rš   r¨   r   r   r   r   Ú<module>   sT   üG   3

)&