ó
    Ñ]j€  ã                  óü   • % S r SSKJr  SSKJrJrJrJrJr  \(       a
  SSK	J
r
JrJr   " S S5      r0 rS\S'   \" S	\S
\4   S9rSS jr\SS j5       r\SS j5       r\SS j5       r\SS j5       r\SS j5       rg)ao  Infrastructure for registering and firing callbacks on application events.

Unlike :mod:`IPython.core.hooks`, which lets end users set single functions to
be called at specific times, or a collection of alternative methods to try,
callbacks are designed to be used by extension authors. A number of callbacks
can be registered for the same event without needing to be aware of one another.

The functions defined in this module are no-ops indicating the names of available
events and the arguments which will be passed to them.

.. note::

   This API is experimental in IPython 2.0, and may be revised in future versions.
é    )Úannotations)ÚTYPE_CHECKINGÚAnyÚCallableÚIterableÚTypeVar)ÚExecutionInfoÚExecutionResultÚInteractiveShellc                  óT   • \ rS rSrSr S	       S
S jjrSS jrSS jrSS jrSr	g)ÚEventManageré   a  Manage a collection of events and a sequence of callbacks for each.

This is attached to :class:`~IPython.core.interactiveshell.InteractiveShell`
instances as an ``events`` attribute.

.. note::

   This API is experimental in IPython 2.0, and may be revised in future versions.
c                óV   • Xl         U Vs0 s H  oD/ _M     snU l        X0l        gs  snf )a=  Initialise the :class:`CallbackManager`.

Parameters
----------
shell
    The :class:`~IPython.core.interactiveshell.InteractiveShell` instance
available_events
    An iterable of names for callback events.
print_on_error:
    A boolean flag to set whether the EventManager will print a warning which a event errors.
N)ÚshellÚ	callbacksÚprint_on_error)Úselfr   Úavailable_eventsr   Úns        ÚP/home/mande/repo/quber/.venv/lib/python3.13/site-packages/IPython/core/events.pyÚ__init__ÚEventManager.__init__'   s4   € ð" Œ
á+ó?
Ú+�aˆrŠEÑ+ñ?
ˆŒð -Õùò?
s   ‹&c                ó¢   • [        U5      (       d  [        SU-  5      eX R                  U   ;  a  U R                  U   R                  U5        gg)a  Register a new event callback.

Parameters
----------
event : str
    The event for which to register this callback.
function : callable
    A function to be called on the given event. It should take the same
    parameters as the appropriate callback prototype.

Raises
------
TypeError
    If ``function`` is not callable.
KeyError
    If ``event`` is not one of the known events.
zNeed a callable, got %rN)ÚcallableÚ	TypeErrorr   Úappend©r   ÚeventÚfunctions      r   ÚregisterÚEventManager.register>   sK   € ô$ ˜×!Ñ!ÜÐ5¸Ñ@ÓAÐAØŸ>™>¨%Ñ0Ó0Ø�N‰N˜5Ñ!×(Ñ(¨Õ2ð 1ó    c                ó–   • X R                   U   ;   a  U R                   U   R                  U5      $ [        SR                  X!5      5      e)z'Remove a callback from the given event.z0Function {!r} is not registered as a {} callback)r   ÚremoveÚ
ValueErrorÚformatr   s      r   Ú
unregisterÚEventManager.unregisterU   sC   € à—~‘~ eÑ,Ó,Ø—>‘> %Ñ(×/Ñ/°Ó9Ð9äÐK×RÑRÐS[ÓcÓdÐdr"   c           
     ó  • U R                   U   SS  H  n U" U0 UD6  M     g! [        [        4 aJ    U R                  (       a  [	        SR                  XAX#5      5        U R                  R                  5          Mj  f = f)z±Call callbacks for ``event``.

Any additional arguments are passed to all callbacks registered for this
event. Exceptions raised by callbacks are caught, and a message printed.
Nz@Error in callback {} (for {}), with arguments args {},kwargs {}:)r   Ú	ExceptionÚKeyboardInterruptr   Úprintr&   r   Úshowtraceback)r   r   ÚargsÚkwargsÚfuncs        r   ÚtriggerÚEventManager.trigger\   s{   € ð —N‘N 5Ñ)©!Ó,ˆDð	+Ù�dÐ%˜fÔ%ò -øô Ô0Ð1ó +Ø×&×&ÜØZ×aÑaØ ¨óôð
 —
‘
×(Ñ(×*ð+ús   —$¤AA>Á=A>)r   r   r   N)T)r   r   r   zIterable[str]r   ÚboolÚreturnÚNone)r   Ústrr   zCallable[..., Any]r4   r5   )r   r6   r.   r   r/   r   r4   r5   )
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r    r'   r1   Ú__static_attributes__© r"   r   r   r      sG   † ñð  $ð	-àð-ð (ð-ð ð	-ð
 
õ-ô.3ô.e÷+r"   r   zdict[str, Callable[..., Any]]r   Ú
_CallbackT.)Úboundc                ó,   • U [         U R                  '   U $ )zADecorator to register a function as an available event prototype.)r   r7   )Úcallback_functions    r   Ú_define_eventrB   s   s   € à3DÔÐ&×/Ñ/Ñ0ØÐr"   c                 ó   • g)z�Fires before code is executed in response to user/frontend action.

This includes comm and widget messages and silent execution, as well as user
code cells.
Nr=   r=   r"   r   Úpre_executerD      ó   € ð 	r"   c                ó   • g)z»Fires before user-entered code runs.

Parameters
----------
info : :class:`~IPython.core.interactiveshell.ExecutionInfo`
    An object containing information used for the code execution.
Nr=   )Úinfos    r   Úpre_run_cellrH   ˆ   ó   € ð 	r"   c                 ó   • g)zœFires after code is executed in response to user/frontend action.

This includes comm and widget messages and silent execution, as well as user
code cells.
Nr=   r=   r"   r   Úpost_executerK   “   rE   r"   c                ó   • g)z»Fires after user-entered code runs.

Parameters
----------
result : :class:`~IPython.core.interactiveshell.ExecutionResult`
    The object which will be returned as the execution result.
Nr=   )Úresults    r   Úpost_run_cellrN   œ   rI   r"   c                ó   • g)a/  Fires after initialisation of :class:`~IPython.core.interactiveshell.InteractiveShell`.

This is before extensions and startup scripts are loaded, so it can only be
set by subclassing.

Parameters
----------
ip : :class:`~IPython.core.interactiveshell.InteractiveShell`
    The newly initialised shell.
Nr=   )Úips    r   Úshell_initializedrQ   §   s   € ð 	r"   N)rA   r>   r4   r>   )r4   r5   )rG   r	   r4   r5   )rM   r
   r4   r5   )rP   r   r4   r5   )r;   Ú
__future__r   Útypingr   r   r   r   r   ÚIPython.core.interactiveshellr	   r
   r   r   r   Ú__annotations__r>   rB   rD   rH   rK   rN   rQ   r=   r"   r   Ú<module>rV      s»   ðòõ #ç BÕ Bæ÷ñ ÷P+ñ P+ðf 35Ð Ð/Ó 4á�\¨°#°s°(Ñ);Ñ<€
ôð ó	ó ð	ð ó	ó ð	ð ó	ó ð	ð ó	ó ð	ð ó	ó ñ	r"   