%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
a
�_g'� � @ s0 d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm
Z
dd lmZ d
dgZ
G dd
� d
�Ze� Ze
G dd� d��Ze
G dd� de��ZG dd� d�ZG dd� dee�Zee�G dd
� d
e��ZG dd� dee�Zee�G dd� de��Zdd� Zdd� Zdd� Zd d!� ZdS )"zAdapter management
� N�� Interface)�implementer��
providedBy)�ro)�_normalize_name)�_use_c_impl)�IAdapterRegistry�AdapterRegistry�VerifyingAdapterRegistryc @ s� e Zd ZdZdZdZd0dd�Zdd� Zed d
� dd
� �Z dd
� Z
eZe
ZeZeZdd� Zdd� Zdd� Zdd� Zdd� Zd1dd�Zed2dd��Zdd� Zdd � Zd3d"d#�Zd$d%� Zd&d'� Zd(d)� Zd4d*d+�Z d,d-� Z!d.d/� Z"d!S )5�BaseAdapterRegistrya�
A basic implementation of the data storage and algorithms required
for a :class:`zope.interface.interfaces.IAdapterRegistry`.
Subclasses can set the following attributes to control how the data
is stored; in particular, these hooks can be helpful for ZODB
persistence. They can be class attributes that are the named
(or similar) type, or they can be methods that act as a constructor
for an object that behaves like the types defined here; this object
will not assume that they are type objects, but subclasses are free
to do so:
_sequenceType = list
This is the type used for our two mutable top-level "byorder" sequences.
Must support mutation operations like ``append()`` and ``del
seq[index]``. These are usually small (< 10). Although at least one of
them is accessed when performing lookups or queries on this object, the
other is untouched. In many common scenarios, both are only required
when mutating registrations and subscriptions (like what
:meth:`zope.interface.interfaces.IComponents.registerUtility` does).
This use pattern makes it an ideal candidate to be a
:class:`~persistent.list.PersistentList`.
_leafSequenceType = tuple
This is the type used for the leaf sequences of subscribers.
It could be set to a ``PersistentList`` to avoid many unnecessary data
loads when subscribers aren't being used. Mutation operations are
directed through :meth:`_addValueToLeaf` and
:meth:`_removeValueFromLeaf`; if you use a mutable type, you'll need to
override those.
_mappingType = dict
This is the mutable mapping type used for the keyed mappings. A
:class:`~persistent.mapping.PersistentMapping` could be used to help
reduce the number of data loads when the registry is large and parts of
it are rarely used. Further reductions in data loads can come from using
a :class:`~BTrees.OOBTree.OOBTree`, but care is required to be sure that
all required/provided values are fully ordered (e.g., no required or
provided values that are classes can be used).
_providedType = dict
This is the mutable mapping type used for the ``_provided`` mapping.
This is separate from the generic mapping type because the values
are always integers, so one might choose to use a more optimized data
structure such as a :class:`~BTrees.OIBTree.OIBTree`.
The same caveats regarding key types
apply as for ``_mappingType``.
It is possible to also set these on an instance, but because of the need
to potentially also override :meth:`_addValueToLeaf` and
:meth:`_removeValueFromLeaf`, this may be less useful in a persistent
scenario; using a subclass is recommended.
.. versionchanged:: 5.3.0
Add support for customizing the way internal data
structures are created.
.. versionchanged:: 5.3.0
Add methods :meth:`rebuild`, :meth:`allRegistrations`
and :meth:`allSubscriptions`.
) �lookup�queryMultiAdapter�lookup1�queryAdapter�adapter_hook� lookupAll�names�
subscriptions�subscribersr � c C s0 | � � | _| � � | _| �� | _| �� || _d S �N)�
_sequenceType� _adapters�_subscribers�
_providedType� _provided�
_createLookup� __bases__��self�basesr r �C/vddos/python/lib/python3.9/site-packages/zope/interface/adapter.py�__init__� s
zBaseAdapterRegistry.__init__c C s$ || j d<