File: //opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/event/__pycache__/base.cpython-37.pyc
B
�'1�f\�� @ s� d Z ddlmZ ddlZddlmZ ddlmZ ddlmZ dd lm Z e �
e�Zd
d� Z
G dd
� d
e�ZG dd� de�ZG dd� de�Zdd� Zdd� ZG dd� de �ee��ZG dd� de�ZG dd� de�ZdS )a� Base implementation classes.
The public-facing ``Events`` serves as the base class for an event interface;
its public attributes represent different kinds of events. These attributes
are mirrored onto a ``_Dispatch`` class, which serves as a container for
collections of listener functions. These collections are represented both
at the class level of a particular ``_Dispatch`` class as well as within
instances of ``_Dispatch``.
� )�absolute_importN� )�_ClsLevelDispatch)�_EmptyListener)�_JoinedListener� )�utilc C s | � d� o| dkS )N�_�dispatch)�
startswith)�name� r
�H/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/event/base.py�_is_event_name s r c @ s e Zd ZdZdd� ZdS )�_UnpickleDispatchz�Serializable callable that re-generates an instance of
:class:`_Dispatch` given a particular :class:`.Events` subclass.
c C s8 x2|j D ] }d|jkr|jd j�|�S qW td��d S )Nr
z*No class with a 'dispatch' member present.)�__mro__�__dict__r
�
_for_class�AttributeError)�self�
_instance_cls�clsr
r
r �__call__) s
z_UnpickleDispatch.__call__N)�__name__�
__module__�__qualname__�__doc__r r
r
r
r r # s r c @ sx e Zd ZdZdZe�� Zddd�Zdd� Z e
dd � �Ze
d
d� �Zdd
� Z
dd� Zdd� Zdd� Zddd�Zdd� ZdS )� _Dispatcha; Mirror the event listening definitions of an Events class with
listener collections.
Classes which define a "dispatch" member will return a
non-instantiated :class:`._Dispatch` subclass when the member
is accessed at the class level. When the "dispatch" member is
accessed at the instance level of its owner, an instance
of the :class:`._Dispatch` class is returned.
A :class:`._Dispatch` class is generated for each :class:`.Events`
class defined, by the :func:`._create_dispatcher_class` function.
The original :class:`.Events` classes remain untouched.
This decouples the construction of :class:`.Events` subclasses from
the implementation used by the event internals, and allows
inspecting tools like Sphinx to work in an unsurprising
way against the public API.
)�_parentr r �_empty_listenersNc sb || _ � | _� rXy| j� | _W q^ tk
rT � fdd�|jD � | _| j� <