§
    kÃ¿a—
  ã                   ót   — d Z ddgZ G d„ de¦  «        Z G d„ de¦  «        Zd„ Zedk    r e¦   «          dS dS )aÚ  
Dirt Simple Events

A Dispatcher (or a subclass of Dispatcher) stores event handlers that
are 'fired' simple event objects when interesting things happen.

Create a dispatcher:

  >>> d = Dispatcher()

Now create a handler for the event and subscribe it to the dispatcher
to handle Event events.  A handler is a simple function or method that
accepts the event as an argument:

  >>> def handler1(event): print(repr(event))
  >>> d.subscribe(Event, handler1) # doctest: +ELLIPSIS
  <rdflib.events.Dispatcher object at ...>

Now dispatch a new event into the dispatcher, and see handler1 get
fired:

  >>> d.dispatch(Event(foo='bar', data='yours', used_by='the event handlers'))
  <rdflib.events.Event ['data', 'foo', 'used_by']>
ÚEventÚ
Dispatcherc                   ó   — e Zd ZdZd„ Zd„ ZdS )r   aÂ  
    An event is a container for attributes.  The source of an event
    creates this object, or a subclass, gives it any kind of data that
    the events handlers need to handle the event, and then calls
    notify(event).

    The target of an event registers a function to handle the event it
    is interested with subscribe().  When a sources calls
    notify(event), each subscriber to that event will be called in no
    particular order.
    c                 ó:   — | j                              |¦  «         d S ©N)Ú__dict__Úupdate)ÚselfÚkws     ú//usr/lib/python3/dist-packages/rdflib/events.pyÚ__init__zEvent.__init__*   s   € ØŒ×Ò˜RÑ Ô Ð Ð Ð ó    c                 ón   — t          | j                             ¦   «         ¦  «        }dd„ |D ¦   «         ›d�S )Nz<rdflib.events.Event c                 ó   — g | ]}|‘ŒS © r   )Ú.0Úas     r   ú
<listcomp>z"Event.__repr__.<locals>.<listcomp>/   s   € Ð-?Ð-?Ð-?°A¨aÐ-?Ð-?Ð-?r   ú>)Úsortedr   Úkeys)r	   Úattrss     r   Ú__repr__zEvent.__repr__-   s<   € Ý�t”}×)Ò)Ñ+Ô+Ñ,Ô,ˆˆØ-?Ð-?¸Ð-?Ñ-?Ô-?Ð-?Ð-?ÐAÐAr   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r      sA   € € € € € ð
ð 
ð!ð !ð !ðBð Bð Bð Bð Br   c                   ó.   — e Zd ZdZdZd„ Zd„ Zd„ Zd„ ZdS )r   z]
    An object that can dispatch events to a privately managed group of
    subscribers.
    Nc                 ó   — || _         | S r   ©Ú_dispatch_map)r	   Úamaps     r   Úset_mapzDispatcher.set_map:   s   € Ø!ˆÔØˆr   c                 ó   — | j         S r   r   )r	   s    r   Úget_mapzDispatcher.get_map>   s   € ØÔ!Ð!r   c                 ó¾   — | j         €|                      i ¦  «         | j                              |d¦  «        }|€|g}n|                     |¦  «         || j         |<   | S )zuSubscribe the given handler to an event_type.  Handlers
        are called in the order they are subscribed.
        N)r    r"   ÚgetÚappend)r	   Ú
event_typeÚhandlerÚlsts       r   Ú	subscribezDispatcher.subscribeA   si   € ð ÔÐ%Ø�LŠL˜ÑÔÐØÔ ×$Ò$ Z°Ñ6Ô6ˆØˆ;Ø�)ˆCˆCà�JŠJ�wÑÔÐØ),ˆÔ˜:Ñ&Øˆr   c                 óÊ   — | j         �Y| j                              t          |¦  «        d¦  «        }|€t          dt          |¦  «        z  ¦  «        ‚|D ]} ||¦  «         ŒdS dS )zPDispatch the given event to the subscribed handlers for
        the event's typeNzunknown event type: %s)r    r&   ÚtypeÚ
ValueError)r	   Úeventr*   Úl_s       r   ÚdispatchzDispatcher.dispatchO   sz   € ð ÔÐ)ØÔ$×(Ò(­¨e©¬°dÑ;Ô;ˆCØˆ{Ý Ð!9½DÀ¹K¼KÑ!GÑHÔHÐHØð ð �Ø��5‘	”	�	�	ð *Ð)ðð r   )	r   r   r   r   r    r"   r$   r+   r1   r   r   r   r   r   2   sa   € € € € € ðð ð
 €Mðð ð ð"ð "ð "ðð ð ðð ð ð ð r   c                  ó6   — dd l } |                      ¦   «          d S )Né    )ÚdoctestÚtestmod)r4   s    r   Útestr6   Z   s!   € Ø€N€N€Nà‡O‚OÑÔÐÐÐr   Ú__main__N)r   Ú__all__Úobjectr   r   r6   r   r   r   r   ú<module>r:      s¨   ðð€ð2 �LÐ
!€ðBð Bð Bð Bð BˆFñ Bô Bð Bð*%ð %ð %ð %ð %�ñ %ô %ð %ðPð ð ð ˆzÒÐØ€D�F„F€F€F€Fð Ðr   