File: //opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/event/base.pyo
�
��4]c           @@  s   d  Z  d d l m Z d d l Z d d l m Z d d l m Z d d l m Z d d	 l m	 Z	 e	 j
 e � Z d
 �  Z
 d e f d �  �  YZ d
 e f d �  �  YZ d e f d �  �  YZ d �  Z d �  Z d e	 j e e � f d �  �  YZ d e f d �  �  YZ d e f d �  �  YZ d S(   s�  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``.
i    (   t   absolute_importNi   (   t   _ClsLevelDispatch(   t   _EmptyListener(   t   _JoinedListeneri   (   t   utilc         C@  s   |  j  d � o |  d k S(   Nt   _t   dispatch(   t
   startswith(   t   name(    (    sH   /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/event/base.pyt   _is_event_name   s    t   _UnpickleDispatchc           B@  s   e  Z d  Z d �  Z RS(   s�   Serializable callable that re-generates an instance of
    :class:`_Dispatch` given a particular :class:`.Events` subclass.
    c         C@  sJ   xC | j  D], } d | j k r
 | j d j j | � Sq
 Wt d � � d  S(   NR   s*   No class with a 'dispatch' member present.(   t   __mro__t   __dict__R   t
   _for_classt   AttributeError(   t   selft
   _instance_clst   cls(    (    sH   /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/event/base.pyt   __call__)   s
    (   t   __name__t
   __module__t   __doc__R   (    (    (    sH   /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/event/base.pyR
   #   s   t	   _Dispatchc           B@  s�   e  Z d  Z d Z e j �  Z d d � Z d �  Z	 e
 d �  � Z e
 d �  � Z d	 �  Z
 d
 �  Z d �  Z d �  Z e d
 � Z d �  Z RS(   s;  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.
    t   _parentR   R   t   _empty_listenersc         @  sw   | |  _  �  |  _ �  rj y |  j �  |  _ Wqs t k
 rf �  f d �  | j D� |  _ |  j �  <qs Xn	 i  |  _ d  S(   Nc         @  s%   i  |  ] } t  | �  � | j � q S(    (   R   R   (   t   .0t   ls(   t   instance_cls(    sH   /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/event/base.pys
   <dictcomp>X   s   	(   R   R   t   _empty_listener_regR   t   KeyErrort   _event_descriptors(   R   t   parentR   (    (   R   sH   /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/event/base.pyt   __init__M   s    		
"c         C@  sL   y |  j  | } Wn t k
 r0 t | � � n Xt |  | j | � | Sd  S(   N(   R   R   R   t   setattrR   (   R   R   R   (    (    sH   /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/event/base.pyt   __getattr__^   s    
c         c@  s&