+
    '(j                         ^ RI Ht ^ RIHt ^ RIHtHtHtHtH	t	H
t
 ^ RIHt ] ! R R4      4       t ! R R4      t]! 4       tR	 R
 ltR R lt]
! R]	R7      tR R ltR# )    )	dataclasswraps)AnyCallableIteratorListTypeTypeVar)EventEmitterc                   ,   a  ] tR t^t o V 3R ltRtV tR# )Handlerc                2   < V ^8  d   Qh/ S[ ;R&   S[;R&   # )   eventmethodstrr   )format__classdict__s   "=/home/ubuntu/cf-venv/lib/python3.14/site-packages/pyee/cls.py__annotate__Handler.__annotate__   s     J        N)__name__
__module____qualname____firstlineno____annotate_func____static_attributes____classdictcell__r   s   @r   r   r      s      r   r   c                   \   a  ] tR t^t o V 3R lR ltV 3R lR ltV 3R lR ltR tRtV t	R	# )
Handlersc                   < V ^8  d   QhRR/# r   returnNr   )r   r   s   "r   r   Handlers.__annotate__   s     + +$ +r   c                    . V n         R # N	_handlersselfs   &r   __init__Handlers.__init__   s	    (*r   c                   < V ^8  d   QhRR/# r'   r   )r   r   s   "r   r   r)      s     ' ' 'r   c                <    V P                   P                  V4       R # r+   )r-   append)r/   handlers   &&r   r4   Handlers.append   s    g&r   c                0   < V ^8  d   QhRS[ S[,          /# r   r(   )r   r   )r   r   s   "r   r   r)      s     $ $(7+ $r   c                ,    \        V P                  4      # r+   )iterr-   r.   s   &r   __iter__Handlers.__iter__   s    DNN##r   c                    . V n         R # r+   r,   r.   s   &r   resetHandlers.reset   s	    r   r,   N)
r   r   r   r   r0   r4   r;   r>   r!   r"   r#   s   @r   r%   r%      s-     + +' '$ $ r   r%   c                T    V ^8  d   QhR\         R\        \        .\        3,          /# )r   r   r(   r   )r   s   "r   r   r      s&     
 
c 
hz834 
r   c                   a  R V 3R llpV# )zf
Register an event handler on an evented class. See the `evented` class
decorator for a full example.
c                0    V ^8  d   QhR\         R\         /# )r   r   r(   )r   )r   s   "r   r   on.<locals>.__annotate__%   s      ( x r   c                 H   < \         P                  \        SV R 7      4       V # ))r   r   )r-   r4   r   )r   r   s   &r   	decoratoron.<locals>.decorator%   s    uV<=r   r   )r   rE   s   f r   onrG      s      r   c                <    V ^8  d   QhR\         R\         R\         /# )r   r/   r   r(   r   )r   s   "r   r   r   ,   s!       S S r   c                 :   a a \        S4      R  VV 3R ll4       pV# )c                $    V ^8  d   QhR\         /# r8   rI   )r   s   "r   r   _bind.<locals>.__annotate__.   s     - -# -r   c                     < S! S.V O5/ VB # r+   r   )argskwargsr   r/   s   *,r   bound_bind.<locals>.bound-   s    d,T,V,,r   r   )r/   r   rP   s   ff r   _bindrR   ,   s%    
6]- - - Lr   Cls)rP   c                0    V ^8  d   QhR\         R\         /# )r   clsr(   )rS   )r   s   "r   r   r   7   s     = = = =r   c                   aa \        \        4      o\        P                  4        V P                  o\	        V P                  4      R VV3R ll4       pWn        V # )a  
Configure an evented class.

Evented classes are classes which use an EventEmitter to call instance
methods during runtime. To achieve this without this helper, you would
instantiate an `EventEmitter` in the `__init__` method and then call
`event_emitter.on` for every method on `self`.

This decorator and the `on` function help make things look a little nicer
by defining the event handler on the method in the class and then adding
the `__init__` hook in a wrapper:

```py
from pyee.cls import evented, on

@evented
class Evented:
    @on("event")
    def event_handler(self, *args, **kwargs):
        print(self, args, kwargs)

evented_obj = Evented()

evented_obj.event_emitter.emit(
    "event", "hello world", numbers=[1, 2, 3]
)
```

The `__init__` wrapper will create a `self.event_emitter: EventEmitter`
automatically but you can also define your own event_emitter inside your
class's unwrapped `__init__` method. For example, to use this
decorator with a `TwistedEventEmitter`::

```py
@evented
class Evented:
    def __init__(self):
        self.event_emitter = TwistedEventEmitter()

    @on("event")
    async def event_handler(self, *args, **kwargs):
        await self.some_async_action(*args, **kwargs)
```
c                @    V ^8  d   QhR\         R\         R\         RR/# )r   r/   rN   rO   r(   NrI   )r   s   "r   r   evented.<locals>.__annotate__j   s.     B B3 Bs Bc Bd Br   c                    < S! V .VO5/ VB  \        V R 4      '       g   \        4       V n        S F<  pV P                  P                  VP                  \        WP                  4      4       K>  	  R# )event_emitterN)hasattrr   rZ   rG   r   rR   r   )r/   rN   rO   hhandlersog_inits   &*, r   initevented.<locals>.initi   sY    &t&v&t_--!-DA!!!''5xx+@A r   )listr-   r>   r0   r   )rU   r_   r]   r^   s   & @@r   eventedrb   7   sQ    Z #9oHOOG
3<<B B B LJr   N)dataclassesr   	functoolsr   typingr   r   r   r	   r
   r   pyeer   r   r%   r-   rG   rR   rS   rb   r   r   r   <module>rg      s]    !  ? ?    
  J	
 e4 =r   