Ë
    �©ïg—v  ã                  ód  — d dl mZ d dlmZmZmZmZmZmZm	Z	m
Z
 ddlmZ ddlmZ d dlmZmZ d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZg d¢Z G d	„ d
e«      Z G d„ dej>                  «      Z  G d„ dejB                  e«      Z" G d„ d«      Z# G d„ de#ejH                  «      Z%y)é    )Úannotations)ÚQCoreApplicationÚ	QDateTimeÚQDeadlineTimerÚ
QEventLoopÚQObjectÚQTimerÚQThreadÚSloté   )Úfutures)Útasks)ÚAnyÚCallableN)ÚQAsyncioEventLoopPolicyÚQAsyncioEventLoopÚQAsyncioHandleÚQAsyncioTimerHandlec                  ó6   ‡ — e Zd ZdZdˆ fd„Zd„ Zd„ Zd„ Zˆ xZS )ÚQAsyncioExecutorWrapperaØ  
    Executors in asyncio allow running synchronous code in a separate thread or
    process without blocking the event loop or interrupting the asynchronous
    program flow. Callables are scheduled for execution by calling submit() or
    map() on an executor object.

    Executors require a bit of extra work for QtAsyncio, as we can't use
    naked Python threads; instead, we must make sure that the thread created
    by executor.submit() has an event loop. This is achieved by not submitting
    the callable directly, but a small wrapper that attaches a QEventLoop to
    the executor thread, and then creates a zero-delay singleshot timer to push
    the actual callable for the executor into this new event loop.
    c                ó^   •— t         ‰| �  «        |  || _        || _        d | _        d | _        y ©N)ÚsuperÚ__init__Ú_funcÚ_argsÚ_resultÚ
_exception)ÚselfÚfuncÚargsÚ	__class__s      €ú8lib/python3.12/site-packages/PySide6/QtAsyncio/events.pyr   z QAsyncioExecutorWrapper.__init__-   s-   ø€ Ü‰ÑÔÙØˆŒ
ØˆŒ
ØˆŒØˆ�ó    c                ó°   — 	  | j                   | j                  Ž | _        | j
                  j                  «        y # t        $ r}|| _        Y d }~Œ0d }~ww xY wr   )r   r   r   ÚBaseExceptionr   Ú_loopÚexit©r   Úes     r#   Ú_cbzQAsyncioExecutorWrapper._cb5   sJ   € ð	 ð &˜4Ÿ:™: t§z¡zÐ2ˆDŒLð 	�
‰
�‰Õøô ò 	 ØˆD�O‰Oûð	 ús   ‚; »	AÁAÁAc                ó"  ‡ — t        «       ‰ _        t        j                  j	                  ‰ j                  «       t        j                  dˆ fd„«       ‰ j                  j                  «        ‰ j                  �‰ j                  ‚‰ j                  S )Nr   c                 ó$   •— ‰ j                  «       S r   ©r+   ©r   s   €r#   Ú<lambda>z,QAsyncioExecutorWrapper.do.<locals>.<lambda>G   s   ø€  T§X¡X¤Zr$   )
r   r'   ÚasyncioÚeventsÚ_set_running_loopr	   Ú
singleShotÚexecr   r   r/   s   `r#   ÚdozQAsyncioExecutorWrapper.do>   sc   ø€ ô  “\ˆŒ
Ü�‰×(Ñ(¨¯©Ô4ô
 	×Ñ˜!Ó/Ô0à�
‰
�‰ÔØ�?‰?Ð&Ø—/‘/Ð!Ø�|‰|Ðr$   c                ó8   — | j                   j                  «        y r   )r'   r(   r/   s    r#   r(   zQAsyncioExecutorWrapper.exitN   s   € Ø�
‰
�‰Õr$   )r    r   r!   ÚtupleÚreturnÚNone)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r+   r6   r(   Ú__classcell__©r"   s   @r#   r   r      s   ø„ ñõòòö r$   r   c                  ó\   ‡ — e Zd ZdZ	 	 d	 	 	 	 	 d	ˆ fd„Zd
d„Zdd„Zd
d„Zdd„Zdd„Z	ˆ xZ
S )r   aC  
    Event loop policies are expected to be deprecated with Python 3.13, with
    subsequent removal in Python 3.15. At that point, part of the current
    logic of the QAsyncioEventLoopPolicy constructor will have to be moved
    to QtAsyncio.run() and/or to a loop factory class (to be provided as an
    argument to asyncio.run()). In particular, this concerns the logic of
    setting up the QCoreApplication and the SIGINT handler.

    More details:
    https://discuss.python.org/t/removing-the-asyncio-policy-system-asyncio-set-event-loop-policy-in-python-3-15/37553
    c                óò   •— t         ‰| �  «        t        j                  «       xs
 t        «       | _        || _        d | _        |r3t        j                  t        j                  t        j                  «       y y r   )
r   r   r   ÚinstanceÚ_applicationÚ
_quit_qappÚ_event_loopÚsignalÚSIGINTÚSIG_DFL)r   Ú	quit_qappÚhandle_sigintr"   s      €r#   r   z QAsyncioEventLoopPolicy.__init__^   sY   ø€ ô 	‰ÑÔÜ,×5Ñ5Ó7ÒMÔ;KÓ;MˆÔð $ˆŒà=AˆÔáÜ�M‰Mœ&Ÿ-™-¬¯©Õ8ð r$   c                ó~   — | j                   €&t        | j                  | j                  ¬«      | _         | j                   S ©N)rJ   )rF   r   rD   rE   r/   s    r#   Úget_event_loopz&QAsyncioEventLoopPolicy.get_event_loopp   s3   € Ø×ÑÐ#Ü0°×1BÑ1BÈdÏoÉoÔ^ˆDÔØ×ÑÐr$   c                ó   — || _         y r   )rF   )r   Úloops     r#   Úset_event_loopz&QAsyncioEventLoopPolicy.set_event_loopu   s
   € ØˆÕr$   c                óD   — t        | j                  | j                  ¬«      S rM   )r   rD   rE   r/   s    r#   Únew_event_loopz&QAsyncioEventLoopPolicy.new_event_loopx   s   € Ü  ×!2Ñ!2¸d¿o¹oÔNÐNr$   c                ó   — t        d«      ‚©Nz/Child watchers are deprecated since Python 3.12©ÚDeprecationWarningr/   s    r#   Úget_child_watcherz)QAsyncioEventLoopPolicy.get_child_watcher{   ó   € Ü Ð!RÓSÐSr$   c                ó   — t        d«      ‚rU   rV   )r   Úwatchers     r#   Úset_child_watcherz)QAsyncioEventLoopPolicy.set_child_watcher~   rY   r$   )TF)rJ   ÚboolrK   r]   r9   r:   )r9   zasyncio.AbstractEventLoop)rP   z asyncio.AbstractEventLoop | Noner9   r:   )r9   ú'asyncio.AbstractChildWatcher')r[   r^   r9   r:   )r;   r<   r=   r>   r   rN   rQ   rS   rX   r\   r?   r@   s   @r#   r   r   R   sI   ø„ ñ
ð $(Ø',ð9Ø ð9à $ð9à15õ9ó$ ó
 óOóT÷Tr$   r   c                  óÞ  — e Zd ZdZ G d„ de«      Z	 dR	 	 	 	 	 dSd„ZdTd„Z	 	 	 	 dUd„ZdVd„Z	d	„ Z
dVd
„ZdWd„ZdWd„ZdVd„ZdVd„Z	 dX	 	 	 dYd„Zdddœ	 	 	 	 	 dZd„Zddœ	 	 	 d[d„Zddœ	 	 	 d[d„Zdddœ	 	 	 	 	 d\d„Zddœ	 	 	 d]d„Zdddœ	 	 	 	 	 d^d„Zddœ	 	 	 d_d„Zd`d„Zdad„Zdddœ	 	 	 	 	 	 	 dbd„Zdcd„Zddd „Z	 dedd!d!d!dddddddd"œd#„Z	 ded!d!d!ddddd$œd%„Z	 dXdddddd&œd'„Z	 dee jB                  e jD                  dd(ddddddd)œ
d*„Z#	 dXdd(ddddd+œd,„Z$dddd-œd.„Z%dfdd/œd0„Z&ddddd1œd2„Z'd3„ Z(d4„ Z)d5„ Z*d6„ Z+d7„ Z,d8„ Z-d9„ Z.dgd:„Z/d;„ Z0d<„ Z1d=„ Z2d>„ Z3dfdd/œd?„Z4d!d!d!d!d@œdA„Z5dgdB„Z6dC„ Z7dD„ Z8dE„ Z9dF„ Z:	 	 	 	 	 	 	 	 dhdG„Z;	 	 	 	 didH„Z<djdI„Z=dddJ„Z>dkdK„Z?dkdL„Z@dWdM„ZAdldN„ZBeCjˆ                  eCjˆ                  eCjˆ                  dOœdP„ZEeCjˆ                  eCjˆ                  eCjˆ                  dOœdQ„ZFy)mr   zb
    Implements the asyncio API:
    https://docs.python.org/3/library/asyncio-eventloop.html
    c                  ó4   ‡ — e Zd ZdZdˆ fd„Zdd„Zdd„Zˆ xZS )ú QAsyncioEventLoop.ShutDownThreada=  
        Used to shut down the default executor when calling
        shutdown_default_executor(). As the executor is a ThreadPoolExecutor,
        it must be shut down in a separate thread as all the threads from the
        thread pool must join, which we want to do without blocking the event
        loop.
        c                óˆ   •— t         ‰| �  «        || _        || _        | j                  j                  | j                  «       y r   )r   r   Ú_futurer'   ÚstartedÚconnectÚshutdown)r   ÚfuturerP   r"   s      €r#   r   z)QAsyncioEventLoop.ShutDownThread.__init__‘   s2   ø€ Ü‰GÑÔØ!ˆDŒLØˆDŒJØ�L‰L× Ñ  §¡Õ/r$   c                 ó   — y r   © r/   s    r#   Úrunz$QAsyncioEventLoop.ShutDownThread.run—   s   € Ør$   c                ó²  — 	 | j                   j                  j                  d¬«       | j                   j                  «       s1| j                   j	                  | j
                  j                  d «       y y # t        $ rY}| j                   j                  «       s5| j                   j	                  | j
                  j                  |«       Y d }~y Y d }~y d }~ww xY w)NT©Úwait)	r'   Ú_default_executorrf   Ú	is_closedÚcall_soon_threadsaferc   Ú
set_resultÚ	ExceptionÚset_exceptionr)   s     r#   rf   z)QAsyncioEventLoop.ShutDownThread.shutdownš   sŸ   € ðSØ—
‘
×,Ñ,×5Ñ5¸4Ð5Ô@Ø—z‘z×+Ñ+Ô-Ø—J‘J×3Ñ3°D·L±L×4KÑ4KÈTÕRð .øäò SØ—z‘z×+Ñ+Ô-Ø—J‘J×3Ñ3°D·L±L×4NÑ4NÐPQ×RÑRô .ûðSús   ‚A0A4 Á4	CÁ=A
CÃC)rg   úfutures.QAsyncioFuturerP   z'QAsyncioEventLoop'r9   r:   ©r9   r:   )r;   r<   r=   r>   r   rj   rf   r?   r@   s   @r#   ÚShutDownThreadra   ˆ   s   ø„ ñ	õ	0ó	÷	Sr$   rv   Tc                ó,  — t         j                  j                  | «       t        j                  | «       || _        || _        t        j                  «       | _        d| _	        d| _
        d| _        t        «       | _        t        j                  j!                  «       | _        | j$                  | _        d | _        d | _        t-        t/        j0                  dd«      «      | _        | j                  j4                  j7                  | j8                  «       y )NFÚPYTHONASYNCIODEBUG)r1   ÚBaseEventLoopr   r   rD   rE   r
   ÚcurrentThreadÚ_threadÚ_closedÚ_quit_from_insideÚ_quit_from_outsideÚsetÚ
_asyncgensÚ
concurrentr   ÚThreadPoolExecutorrn   Údefault_exception_handlerÚ_exception_handlerÚ_task_factoryÚ_future_to_completer]   ÚosÚgetenvÚ_debugÚaboutToQuitre   Ú_about_to_quit_cb)r   ÚapplicationrJ   s      r#   r   zQAsyncioEventLoop.__init__£   sâ   € ä×Ñ×&Ñ& tÔ,Ü×Ñ˜Ôà.9ˆÔð $ˆŒä×,Ñ,Ó.ˆŒàˆŒð "'ˆÔØ"'ˆÔô @C»uˆŒô ",×!3Ñ!3×!FÑ!FÓ!HˆÔð 48×3QÑ3QˆÔð /3ˆÔð CGˆÔ äœ2Ÿ9™9Ð%9¸5ÓAÓBˆŒà×Ñ×%Ñ%×-Ñ-¨d×.DÑ.DÕEr$   c                óª   — |j                  «       s%t        |j                  «       t        t        f«      ry|j                  «       j                  «        y)z‡
        A callback that stops the loop when the future is done, used when
        running the loop with run_until_complete().
        N)Ú	cancelledÚ
isinstanceÚ	exceptionÚ
SystemExitÚKeyboardInterruptÚget_loopÚstop)r   rg   s     r#   Ú_run_until_complete_cbz(QAsyncioEventLoop._run_until_complete_cbÛ   s?   € ð
 ×ÑÔ!Ü˜&×*Ñ*Ó,¬zÔ;LÐ.MÔNØØ�‰Ó×ÑÕ r$   c                ó®  — | j                  «       rt        d«      ‚| j                  «       rt        d«      ‚t        j                  j                  |«       }t        j                  j                  || ¬«      }|j                  | j                  «       || _
        	 | j                  «        	 |j!                  | j                  «       |j                  «       st        d«      ‚|j#                  «       S # t        $ r9}|r0|j                  «       r |j                  «       s|j                  «        |‚d }~ww xY w# |j!                  | j                  «       w xY w)NúEvent loop is closedúEvent loop is already running©rP   z*Event loop stopped before Future completed)ro   ÚRuntimeErrorÚ
is_runningr1   r   Úisfuturer   Úensure_futureÚadd_done_callbackr•   r†   Úrun_foreverrr   ÚdonerŽ   r�   Úremove_done_callbackÚresult)r   rg   Úarg_was_coror*   s       r#   Úrun_until_completez$QAsyncioEventLoop.run_until_completeå   s  € à�>‰>ÔÜÐ5Ó6Ð6Ø�?‰?ÔÜÐ>Ó?Ð?ä"Ÿ?™?×3Ñ3°FÓ;Ð;ˆÜ—‘×,Ñ,¨V¸$Ð,Ó?ˆØ× Ñ  ×!<Ñ!<Ô=Ø#)ˆÔ ð	EØ×ÑÕð ×'Ñ'¨×(CÑ(CÔDØ�{‰{Œ}ÜÐKÓLÐLà�}‰}‹Ðøô ò 	Ù §¡¤°f×6FÑ6FÔ6HØ× Ñ Ô"ØˆGûð	ûð
 ×'Ñ'¨×(CÑ(CÕDús$   ÂC2 Ã2	D4Ã;4D/Ä/D4Ä4D7 Ä7Ec                ó   — | j                  «       rt        d«      ‚| j                  «       rt        d«      ‚t        j                  j                  | «       | j                  j                  «        t        j                  j                  d «       y )Nr—   r˜   )ro   rš   r›   r1   r2   r3   rD   r5   r/   s    r#   rŸ   zQAsyncioEventLoop.run_foreverþ   sd   € Ø�>‰>ÔÜÐ5Ó6Ð6Ø�?‰?ÔÜÐ>Ó?Ð?Ü�‰×(Ñ(¨Ô.Ø×Ñ×ÑÔ Ü�‰×(Ñ(¨Õ.r$   c                óL   — | j                   sd| _        | j                  «        yy)z@ A callback for the aboutToQuit signal of the QCoreApplication. TN)r}   r~   Úcloser/   s    r#   r‹   z#QAsyncioEventLoop._about_to_quit_cb  s#   € à×%Ò%ð
 '+ˆDÔ#Ø�J‰J�Lð &r$   c                ó¾   — | j                   �#| j                   j                  «       rd | _         ny d| _        | j                  r| j                  j                  «        y y )NT)r†   r    r}   rE   rD   Úquitr/   s    r#   r”   zQAsyncioEventLoop.stop  sU   € Ø×#Ñ#Ð/Ø×'Ñ'×,Ñ,Ô.Ø+/�Õ(ð à!%ˆÔð
 �?Š?Ø×Ñ×"Ñ"Õ$ð r$   c                ó<   — | j                   j                  «       dkD  S ©Nr   )r{   Ú	loopLevelr/   s    r#   r›   zQAsyncioEventLoop.is_running"  s   € Ø�|‰|×%Ñ%Ó'¨!Ñ+Ð+r$   c                ó   — | j                   S r   )r|   r/   s    r#   ro   zQAsyncioEventLoop.is_closed%  s   € Ø�|‰|Ðr$   c                óÒ   — | j                  «       r| j                  st        d«      ‚| j                  «       ry | j                  �| j                  j                  d¬«       d| _        y )Nz!Cannot close a running event loopFrl   T)r›   r~   rš   ro   rn   rf   r|   r/   s    r#   r§   zQAsyncioEventLoop.close(  sW   € Ø�?‰?Ô T×%<Ò%<ÜÐBÓCÐCØ�>‰>ÔØØ×!Ñ!Ð-Ø×"Ñ"×+Ñ+°Ð+Ô7Øˆ�r$   c              ƒ  ó¤  K  — t        | j                  «      sy t        j                  j                  | j                  D �cg c]  }|j                  «       ‘Œ c}ddiŽƒ d {  –—† }t        || j                  «      D ]/  \  }}t        |t        «      sŒ| j                  d|› d�||dœ«       Œ1 | j                  j                  «        y c c}w 7 Œl­w)NÚreturn_exceptionsTzClosing asynchronous generator zraised an exception)Úmessager�   Úasyncgen)Úlenr€   r1   r   ÚgatherÚacloseÚzipr�   rr   Úcall_exception_handlerÚclear)r   r²   Úresultsr¢   s       r#   Úshutdown_asyncgensz$QAsyncioEventLoop.shutdown_asyncgens1  s¾   è ø€ Ü�4—?‘?Ô#ØäŸ™×,Ñ,Ø04·²Ó@± Hˆh�o‰oÕ°Ñ@ð$à"ñ$÷ $ˆô !$ G¨T¯_©_Ö =ÑˆF�HÜ˜&¤)Õ,Ø×+Ñ+Ø!@ÀÀ
Ø!4ð 6à!'Ø (ñ	-*õ +ð !>ð 	�‰×ÑÕùò Að$ús#   ‚>CÁ C	Á
CÁ!CÁ"0CÂ<CNc              ƒ  óè  K  — d}|�t        t        |dz  «      «      }nt        t         j                  «      }| j                  €y | j	                  «       }t
        j                  || «      }|j                  «        	 |ƒ d {  –—†  |j                  |«      }|�@|s=t        j                  d|› d�t        d¬«       | j                  j                  d¬«       y y y 7 ŒX# |j                  |«      }w xY w­w)NFéè  z/Could not shutdown the default executor within z secondsé   )Ú
stacklevelrl   )r   ÚintÚForeverrn   Úcreate_futurer   rv   Ústartrm   ÚwarningsÚwarnÚRuntimeWarningrf   )r   ÚtimeoutÚshutdown_successfulÚdeadline_timerrg   Úthreads         r#   Úshutdown_default_executorz+QAsyncioEventLoop.shutdown_default_executorC  sä   è ø€ à#ÐØÐÜ+¬C°¸$±Ó,?Ó@‰Nä+¬N×,BÑ,BÓCˆNà×!Ñ!Ð)ØØ×#Ñ#Ó%ˆÜ"×1Ñ1°&¸$Ó?ˆØ�‰Œð	>Ø�LˆLà"(§+¡+¨nÓ"=ÐàÐÑ':Ü�M‰MØAÀ'ÀÈ(ÐSÜ¨1õ.ð ×"Ñ"×+Ñ+°Ð+Õ7ð	 (;Ðð	 ùà"(§+¡+¨nÓ"=Ñüs1   ‚A9C2Á<C ÂCÂC ÂAC2ÃC ÃC/Ã/C2F©ÚcontextÚis_threadsafec               ó2   —  | j                   d|g|¢­||dœŽS )Nr   rË   ©Ú_call_later_impl)r   ÚcallbackrÌ   rÍ   r!   s        r#   Ú_call_soon_implz!QAsyncioEventLoop._call_soon_impl]  s2   € ð %ˆt×$Ñ$ Q¨ð B°4ñ BÀØ3@òBð 	Br$   ©rÌ   c               ó0   —  | j                   |g|¢­|ddœŽS ©NFrË   )rÒ   ©r   rÑ   rÌ   r!   s       r#   Ú	call_soonzQAsyncioEventLoop.call_soonc  s"   € à#ˆt×#Ñ# HÐZ¨tÑZ¸WÐTYÒZÐZr$   c               ó’   — | j                  «       rt        d«      ‚|€t        j                  «       } | j                  |g|¢­|ddœŽS )Nr—   TrË   )ro   rš   ÚcontextvarsÚcopy_contextrÒ   rÖ   s       r#   rp   z&QAsyncioEventLoop.call_soon_threadsafeg  sK   € à�>‰>ÔÜÐ5Ó6Ð6Øˆ?Ü!×.Ñ.Ó0ˆGØ#ˆt×#Ñ# HÐY¨tÑY¸WÐTXÒYÐYr$   c               ó–   — t        |t        t        f«      st        d«      ‚ | j                  | j                  «       |z   |g|¢­||dœŽS )Nzdelay must be an int or floatrË   )r�   r¿   ÚfloatÚ	TypeErrorÚ_call_at_implÚtime)r   ÚdelayrÑ   rÌ   rÍ   r!   s         r#   rÐ   z"QAsyncioEventLoop._call_later_implo  sT   € ô ˜%¤#¤u Ô.ÜÐ;Ó<Ð<Ø!ˆt×!Ñ! $§)¡)£+°Ñ"5°xð ?À$ñ ?ÐPWØ0=ò?ð 	?r$   c               ó2   —  | j                   ||g|¢­|ddœŽS rÕ   rÏ   )r   rà   rÑ   rÌ   r!   s        r#   Ú
call_laterzQAsyncioEventLoop.call_laterw  s$   € à$ˆt×$Ñ$ U¨HÐb°tÑbÀWÐ\aÒbÐbr$   c               óf   — t        |t        t        f«      st        d«      ‚t	        |||| ||¬«      S )z< All call_at() and call_later() methods map to this method. zwhen must be an int or float)rÍ   )r�   r¿   rÜ   rÝ   r   )r   ÚwhenrÑ   rÌ   rÍ   r!   s         r#   rÞ   zQAsyncioEventLoop._call_at_impl{  s4   € ô ˜$¤¤e Ô-ÜÐ:Ó;Ð;Ü" 4¨°4¸¸wÐVcÔdÐdr$   c               ó2   —  | j                   ||g|¢­|ddœŽS rÕ   )rÞ   )r   rä   rÑ   rÌ   r!   s        r#   Úcall_atzQAsyncioEventLoop.call_atƒ  s$   € à!ˆt×!Ñ! $¨Ð^°4Ñ^ÀÐX]Ò^Ð^r$   c                ó0   — t        j                  «       dz  S )Nr¼   )r   ÚcurrentMSecsSinceEpochr/   s    r#   rß   zQAsyncioEventLoop.time‡  s   € Ü×/Ñ/Ó1°DÑ8Ð8r$   c                ó.   — t        j                  | ¬«      S )Nr™   )r   ÚQAsyncioFuturer/   s    r#   rÁ   zQAsyncioEventLoop.create_futureŒ  s   € Ü×%Ñ%¨4Ô0Ð0r$   )ÚnamerÌ   c               óž   — | j                   €t        j                  || ||¬«      }|S | j                  | ||¬«      }|j                  |«       |S )N)rP   rë   rÌ   rÓ   )r…   r   ÚQAsyncioTaskÚset_name)r   Úcororë   rÌ   Útasks        r#   Úcreate_taskzQAsyncioEventLoop.create_task�  sW   € ð ×ÑÐ%Ü×%Ñ% d°¸DÈ'ÔRˆDð
 ˆð ×%Ñ% d¨D¸'Ð%ÓBˆDØ�M‰M˜$Ôàˆr$   c                óB   — |�t        |«      st        d«      ‚|| _        y )Nz+The task factory must be a callable or None)ÚcallablerÝ   r…   )r   Úfactorys     r#   Úset_task_factoryz"QAsyncioEventLoop.set_task_factory›  s#   € ØÐ¤x°Ô'8ÜÐIÓJÐJØ$ˆÕr$   c                ó   — | j                   S r   )r…   r/   s    r#   Úget_task_factoryz"QAsyncioEventLoop.get_task_factory   s   € Ø×!Ñ!Ð!r$   r   )ÚsslÚfamilyÚprotoÚflagsÚsockÚ
local_addrÚserver_hostnameÚssl_handshake_timeoutÚssl_shutdown_timeoutÚhappy_eyeballs_delayÚ
interleavec             ƒ  ó    K  — t        d«      ‚­w)Nz<QAsyncioEventLoop.create_connection() is not implemented yet©ÚNotImplementedError)r   Úprotocol_factoryÚhostÚportrø   rù   rú   rû   rü   rý   rþ   rÿ   r   r  r  s                  r#   Úcreate_connectionz#QAsyncioEventLoop.create_connection¥  s   è ø€ ô "Ð"`ÓaÐaùó   ‚)rù   rú   rû   Úreuse_addressÚ
reuse_portÚallow_broadcastrü   c             ƒ  ó    K  — t        d«      ‚­w)NzCQAsyncioEventLoop.create_datagram_endpoint() is not implemented yetr  )r   r  rý   Úremote_addrrù   rú   rû   r  r  r  rü   s              r#   Úcreate_datagram_endpointz*QAsyncioEventLoop.create_datagram_endpoint¯  s   è ø€ ô
 "ØQóSð 	Sùr
  )rø   rü   rþ   rÿ   r   c             ƒ  ó    K  — t        d«      ‚­w)NzAQAsyncioEventLoop.create_unix_connection() is not implemented yetr  )r   r  Úpathrø   rü   rþ   rÿ   r   s           r#   Úcreate_unix_connectionz(QAsyncioEventLoop.create_unix_connection·  s   è ø€ ô "ØOóQð 	Qùr
  éd   )
rù   rû   rü   Úbacklogrø   r  r  rÿ   r   Ústart_servingc       
      ƒ  ó    K  — t        d«      ‚­w)Nz8QAsyncioEventLoop.create_server() is not implemented yetr  )r   r  r  r  rù   rû   rü   r  rø   r  r  rÿ   r   r  s                 r#   Úcreate_serverzQAsyncioEventLoop.create_serverÂ  s   è ø€ ô "Ð"\Ó]Ð]ùr
  )rü   r  rø   rÿ   r   r  c             ƒ  ó    K  — t        d«      ‚­w)Nz=QAsyncioEventLoop.create_unix_server() is not implemented yetr  )	r   r  r  rü   r  rø   rÿ   r   r  s	            r#   Úcreate_unix_serverz$QAsyncioEventLoop.create_unix_serverÌ  s   è ø€ ô "Ð"aÓbÐbùr
  )rø   rÿ   r   c             ƒ  ó    K  — t        d«      ‚­w)NzBQAsyncioEventLoop.connect_accepted_socket() is not implemented yetr  )r   r  rü   rø   rÿ   r   s         r#   Úconnect_accepted_socketz)QAsyncioEventLoop.connect_accepted_socketÔ  s   è ø€ ô
 "ØPóRð 	Rùr
  )Úfallbackc             ƒ  ó    K  — t        d«      ‚­w)Nz3QAsyncioEventLoop.sendfile() is not implemented yetr  )r   Ú	transportÚfileÚoffsetÚcountr  s         r#   ÚsendfilezQAsyncioEventLoop.sendfileÞ  s   è ø€ ä!Ð"WÓXÐXùr
  )Úserver_siderþ   rÿ   r   c             ƒ  ó    K  — t        d«      ‚­w)Nz4QAsyncioEventLoop.start_tls() is not implemented yetr  )r   r  ÚprotocolÚ
sslcontextr$  rþ   rÿ   r   s           r#   Ú	start_tlszQAsyncioEventLoop.start_tlsä  s   è ø€ ô
 "Ð"XÓYÐYùr
  c                ó   — t        d«      ‚)Nz5QAsyncioEventLoop.add_reader() is not implemented yetr  ©r   ÚfdrÑ   r!   s       r#   Ú
add_readerzQAsyncioEventLoop.add_readerí  ó   € Ü!Ð"YÓZÐZr$   c                ó   — t        d«      ‚)Nz8QAsyncioEventLoop.remove_reader() is not implemented yetr  ©r   r+  s     r#   Úremove_readerzQAsyncioEventLoop.remove_readerð  ó   € Ü!Ð"\Ó]Ð]r$   c                ó   — t        d«      ‚)Nz5QAsyncioEventLoop.add_writer() is not implemented yetr  r*  s       r#   Ú
add_writerzQAsyncioEventLoop.add_writeró  r-  r$   c                ó   — t        d«      ‚)Nz8QAsyncioEventLoop.remove_writer() is not implemented yetr  r/  s     r#   Úremove_writerzQAsyncioEventLoop.remove_writerö  r1  r$   c              ƒ  ó    K  — t        d«      ‚­w)Nz4QAsyncioEventLoop.sock_recv() is not implemented yetr  )r   rü   Únbytess      r#   Ú	sock_recvzQAsyncioEventLoop.sock_recvû  s   è ø€ Ü!Ð"XÓYÐYùr
  c              ƒ  ó    K  — t        d«      ‚­w)Nz9QAsyncioEventLoop.sock_recv_into() is not implemented yetr  )r   rü   Úbufs      r#   Úsock_recv_intoz QAsyncioEventLoop.sock_recv_intoþ  s   è ø€ Ü!Ð"]Ó^Ð^ùr
  c              ƒ  ó    K  — t        d«      ‚­w)Nz8QAsyncioEventLoop.sock_recvfrom() is not implemented yetr  )r   rü   Úbufsizes      r#   Úsock_recvfromzQAsyncioEventLoop.sock_recvfrom  s   è ø€ Ü!Ð"\Ó]Ð]ùr
  c              ƒ  ó    K  — t        d«      ‚­w)Nz=QAsyncioEventLoop.sock_recvfrom_into() is not implemented yetr  )r   rü   r:  r7  s       r#   Úsock_recvfrom_intoz$QAsyncioEventLoop.sock_recvfrom_into  ó   è ø€ Ü!Ð"aÓbÐbùr
  c              ƒ  ó    K  — t        d«      ‚­w)Nz7QAsyncioEventLoop.sock_sendall() is not implemented yetr  )r   rü   Údatas      r#   Úsock_sendallzQAsyncioEventLoop.sock_sendall  ó   è ø€ Ü!Ð"[Ó\Ð\ùr
  c              ƒ  ó    K  — t        d«      ‚­w)Nz6QAsyncioEventLoop.sock_sendto() is not implemented yetr  )r   rü   rC  Úaddresss       r#   Úsock_sendtozQAsyncioEventLoop.sock_sendto
  ó   è ø€ Ü!Ð"ZÓ[Ð[ùr
  c              ƒ  ó    K  — t        d«      ‚­w)Nz7QAsyncioEventLoop.sock_connect() is not implemented yetr  )r   rü   rG  s      r#   Úsock_connectzQAsyncioEventLoop.sock_connect  rE  r
  c              ƒ  ó    K  — t        d«      ‚­w)Nz6QAsyncioEventLoop.sock_accept() is not implemented yetr  )r   rü   s     r#   Úsock_acceptzQAsyncioEventLoop.sock_accept  rI  r
  c             ƒ  ó    K  — t        d«      ‚­w)Nz8QAsyncioEventLoop.sock_sendfile() is not implemented yetr  )r   rü   r   r!  r"  r  s         r#   Úsock_sendfilezQAsyncioEventLoop.sock_sendfile  s   è ø€ ä!Ð"\Ó]Ð]ùr
  )rù   Útyperú   rû   c             ƒ  ó    K  — t        d«      ‚­w)Nz6QAsyncioEventLoop.getaddrinfo() is not implemented yetr  )r   r  r  rù   rP  rú   rû   s          r#   ÚgetaddrinfozQAsyncioEventLoop.getaddrinfo  s   è ø€ ä!Ð"ZÓ[Ð[ùr
  c              ƒ  ó    K  — t        d«      ‚­w)Nz6QAsyncioEventLoop.getnameinfo() is not implemented yetr  )r   Úsockaddrrû   s      r#   ÚgetnameinfozQAsyncioEventLoop.getnameinfo  rI  r
  c              ƒ  ó    K  — t        d«      ‚­w)Nz<QAsyncioEventLoop.connect_read_pipe() is not implemented yetr  ©r   r  Úpipes      r#   Úconnect_read_pipez#QAsyncioEventLoop.connect_read_pipe"  s   è ø€ Ü!Ð"`ÓaÐaùr
  c              ƒ  ó    K  — t        d«      ‚­w)Nz=QAsyncioEventLoop.connect_write_pipe() is not implemented yetr  rW  s      r#   Úconnect_write_pipez$QAsyncioEventLoop.connect_write_pipe%  rA  r
  c                ó   — t        d«      ‚)Nz=QAsyncioEventLoop.add_signal_handler() is not implemented yetr  )r   ÚsigrÑ   r!   s       r#   Úadd_signal_handlerz$QAsyncioEventLoop.add_signal_handler*  s   € Ü!Ð"aÓbÐbr$   c                ó   — t        d«      ‚)Nz@QAsyncioEventLoop.remove_signal_handler() is not implemented yetr  )r   r]  s     r#   Úremove_signal_handlerz'QAsyncioEventLoop.remove_signal_handler-  s   € Ü!ØNóPð 	Pr$   c                óà   — | j                  «       rt        d«      ‚|€| j                  }t        |g|¢­Ž }t        j
                  j                  |j                  |j                  «      | ¬«      S )Nr—   r™   )	ro   rš   rn   r   r1   r   Úwrap_futureÚsubmitr6   )r   Úexecutorr    r!   Úwrappers        r#   Úrun_in_executorz!QAsyncioEventLoop.run_in_executor3  sj   € ð �>‰>ÔÜÐ5Ó6Ð6ØÐØ×-Ñ-ˆHô *¨$Ð6°Ò6ˆÜ�‰×*Ñ*Ø�O‰O˜GŸJ™JÓ'¨dð +ó 
ð 	
r$   c                óp   — t        |t        j                  j                  «      st	        d«      ‚|| _        y )Nz)The executor must be a ThreadPoolExecutor)r�   r�   r   r‚   rÝ   rn   )r   rd  s     r#   Úset_default_executorz&QAsyncioEventLoop.set_default_executorF  s,   € ä˜(¤J×$6Ñ$6×$IÑ$IÔJÜÐGÓHÐHØ!)ˆÕr$   c                óB   — |�t        |«      st        d«      ‚|| _        y )Nz&The handler must be a callable or None)ró   rÝ   r„   )r   Úhandlers     r#   Úset_exception_handlerz'QAsyncioEventLoop.set_exception_handlerN  s#   € ØÐ¤x°Ô'8ÜÐDÓEÐEØ")ˆÕr$   c                ó   — | j                   S r   ©r„   r/   s    r#   Úget_exception_handlerz'QAsyncioEventLoop.get_exception_handlerS  s   € Ø×&Ñ&Ð&r$   c                ót   — |d   r3t        |d   › d|d   j                  › d�dz   «       t        |d   «       y y )Nr±   z from task rð   Ú,zread the following traceback:Ú	traceback)ÚprintÚ_name©r   rÌ   s     r#   rƒ   z+QAsyncioEventLoop.default_exception_handlerV  sL   € à�9ÒÜ�W˜YÑ'Ð(¨°G¸F±O×4IÑ4IÐ3JÈ!ÐLØ3ñ4ô 5ä�'˜+Ñ&Õ'ð r$   c                ó@   — | j                   �| j                  |«       y y r   rm  rt  s     r#   r·   z(QAsyncioEventLoop.call_exception_handler]  s!   € Ø×"Ñ"Ð.Ø×#Ñ# GÕ,ð /r$   c                ó   — | j                   S r   ©r‰   r/   s    r#   Ú	get_debugzQAsyncioEventLoop.get_debugc  s   € ð �{‰{Ðr$   c                ó   — || _         y r   rw  )r   Úenableds     r#   Ú	set_debugzQAsyncioEventLoop.set_debugh  s	   € Øˆ�r$   )ÚstdinÚstdoutÚstderrc             �  ó    K  — t        d«      ‚­w)Nz:QAsyncioEventLoop.subprocess_exec() is not implemented yetr  )r   r  r|  r}  r~  r!   Úkwargss          r#   Úsubprocess_execz!QAsyncioEventLoop.subprocess_execm  s   è ø€ ô
 "Ð"^Ó_Ð_ùr
  c             ‹  ó    K  — t        d«      ‚­w)Nz;QAsyncioEventLoop.subprocess_shell() is not implemented yetr  )r   r  Úcmdr|  r}  r~  r€  s          r#   Úsubprocess_shellz"QAsyncioEventLoop.subprocess_shellt  s   è ø€ ô
 "Ð"_Ó`Ð`ùr
  )T)rŒ   r   rJ   r]   r9   r:   )rg   rt   r9   r:   )rg   rt   r9   r   ru   ©r9   r]   r   )rÆ   zint | float | Noner9   r:   )
rÑ   r   r!   r   rÌ   úcontextvars.Context | NonerÍ   úbool | Noner9   úasyncio.Handle)rÑ   r   r!   r   rÌ   r†  r9   rˆ  )rà   úint | floatrÑ   r   r!   r   rÌ   r†  rÍ   r‡  r9   úasyncio.TimerHandle)
rà   r‰  rÑ   r   r!   r   rÌ   r†  r9   rŠ  )rä   r‰  rÑ   r   r!   r   rÌ   r†  rÍ   r‡  r9   rŠ  )
rä   r‰  rÑ   r   r!   r   rÌ   r†  r9   rŠ  ©r9   rÜ   )r9   rt   )rï   z5collections.abc.Generator | collections.abc.Coroutinerë   z
str | NonerÌ   r†  r9   ztasks.QAsyncioTask)rô   úCallable | Noner9   r:   )r9   rŒ  )NN)r   N)r   )rd  ú,concurrent.futures.ThreadPoolExecutor | Noner    r   r!   r8   r9   zasyncio.futures.Future)rd  r�  r9   r:   )rj  rŒ  r9   r:   )rÌ   zdict[str, Any]r9   r:   )rz  r]   r9   r:   )Gr;   r<   r=   r>   r
   rv   r   r•   r¤   rŸ   r‹   r”   r›   ro   r§   rº   rÊ   rÒ   r×   rp   rÐ   râ   rÞ   ræ   rß   rÁ   rñ   rõ   r÷   r	  r  r  ÚsocketÚ	AF_UNSPECÚ
AI_PASSIVEr  r  r  r#  r(  r,  r0  r3  r5  r8  r;  r>  r@  rD  rH  rK  rM  rO  rR  rU  rY  r[  r^  r`  rf  rh  rk  rn  rƒ   r·   rx  r{  Ú
subprocessÚPIPEr�  r„  ri   r$   r#   r   r   ‚   sã  „ ñô
S˜ô Sð8 CGð4FØ.ð4FØ;?ð4FØKOó4Fóp!ðØ#9ðØ>Aóó2/òó%ó",óóó ð& GKð8Ø1Cð8ØOSó8ð6 ?CØ5:ñBØ!;ðBà'2ðBà?MóBð 9=ñ[Ø5ð[ØAOó[ð
 DHñZØ&@ðZØLZóZð @DØ6;ñ?Ø"<ð?à(3ð?à@Só?ð :>ñcØ6ðcØBUócð
 =AØ38ñeØ9ðeà%0ðeà=Póeð 7;ñ_Ø3ð_Ø?Ró_ó9ó
1ð
 +/Ø:>ñ
ØOð
à'ð
ð 8ð
ð DVó
ó%ó
"ð 59ðbà ¨Ø˜$¨4Ø Ø"&Ø!%Ø!%°$ôbð EIðSà./°qÀØ59ÀdØ7;À$ô	Sð *.ðQà˜4Ø Ø"&Ø!%ôQð 59ð^à×&Ñ&Ø×#Ñ#¨$¸Ø D°TØ"&Ø!%Øô^ð *.ðcà˜s¨Ø"&Ø!%Øôcð Ø"&Ø!%ô	RðYØ#'ôYð %*Ø(,Ø.2Ø-1ô	Zò[ò^ò[ò^ò
Zò_ò^ócò]ò\ò]ò\ð^Ø%)ô^ð "#¨°!¸1ô\ó\ò
bòcò
còPð
Ø"Nð
à&ð
à/4ð
à9Oó
ð&*Ø'Sð*ØX\ó*ó*ó
'ó(ó-óó
ð %/§O¡OØ%/§_¡_Ø%/§_¡_ô`ð &0§_¡_Ø&0§o¡oØ&0§o¡oõar$   r   c                  ó�   — e Zd ZdZ G d„ dej
                  «      Z	 d	 	 	 	 	 	 	 dd„Zdd„Zdd„Z	 e
«       dd„«       Zdd„Zdd	„Zy
)r   a  
    The handle enqueues a callback to be executed by the event loop, and allows
    for this callback to be cancelled before it is executed. This callback will
    typically execute the step function for a task. This makes the handle one
    of the main components of asyncio.
    c                  ór   — e Zd Z ej                  «       Z ej                  «       Z ej                  «       Zy)úQAsyncioHandle.HandleStateN)r;   r<   r=   ÚenumÚautoÚPENDINGÚ	CANCELLEDÚDONEri   r$   r#   ÚHandleStater•  ƒ  s)   „ Ø�$—)‘)“+ˆØ�D—I‘I“Kˆ	Øˆt�y‰y‹{‰r$   r›  c                ó¶   — || _         || _        || _        || _        || _        d| _        t        j                  j                  | _	        | j                  «        y r«   )Ú	_callbackr   r'   Ú_contextÚ_is_threadsafeÚ_timeoutr   r›  r˜  Ú_stateÚ_start)r   rÑ   r!   rP   rÌ   rÍ   s         r#   r   zQAsyncioHandle.__init__ˆ  sK   € ð "ˆŒØˆŒ
ØˆŒ
ØˆŒØ+ˆÔàˆŒä$×0Ñ0×8Ñ8ˆŒØ�‰�r$   c                óD   ‡ — ‰ j                  ‰ j                  ˆ fd„«       y )Nc                 ó$   •— ‰ j                  «       S r   r.   r/   s   €r#   r0   z'QAsyncioHandle._start.<locals>.<lambda>—  s   ø€ °D·H±H´Jr$   )Ú_schedule_eventr   r/   s   `r#   r¢  zQAsyncioHandle._start–  s   ø€ Ø×Ñ˜TŸ]™]Ó,>Õ?r$   c                óð   — | j                   j                  «       s\| j                   j                  sE| j                  r"t	        j
                  || j                   |«       y t	        j
                  ||«       y y y r   )r'   ro   r~   rŸ  r	   r4   )r   rÆ   r    s      r#   r¥  zQAsyncioHandle._schedule_event™  sZ   € ð �z‰z×#Ñ#Ô%¨d¯j©j×.KÒ.KØ×"Ò"ô ×!Ñ! '¨4¯:©:°tÕ<ä×!Ñ! '¨4Õ0ð /LÐ%r$   c                ó@  — | j                   t        j                  j                  k(  rw| j                  �2 | j                  j
                  | j                  g| j                  ¢­Ž  n | j                  | j                  Ž  t        j                  j                  | _         yy)z�
        A slot, enqueued into the event loop, that wraps around the actual
        callback, typically the step function of a task.
        N)	r¡  r   r›  r˜  rž  rj   r�  r   rš  r/   s    r#   r+   zQAsyncioHandle._cb¨  sq   € ð �;‰;œ.×4Ñ4×<Ñ<Ò<Ø�}‰}Ð(Ø!�—‘×!Ñ! $§.¡.Ð>°4·:±:Ô>à�—‘ §
¡
Ñ+Ü(×4Ñ4×9Ñ9ˆD�Kð =r$   c                ó’   — | j                   t        j                  j                  k(  r t        j                  j                  | _         y y r   )r¡  r   r›  r˜  r™  r/   s    r#   ÚcancelzQAsyncioHandle.cancelµ  s4   € Ø�;‰;œ.×4Ñ4×<Ñ<Ò<ô )×4Ñ4×>Ñ>ˆD�Kð	 =r$   c                óP   — | j                   t        j                  j                  k(  S r   )r¡  r   r›  r™  r/   s    r#   rŽ   zQAsyncioHandle.cancelled¼  s   € Ø�{‰{œn×8Ñ8×BÑBÑBÐBr$   N©F)rÑ   r   r!   r8   rP   r   rÌ   r†  rÍ   r‡  r9   r:   ru   )rÆ   r¿   r    r   r9   r:   r…  )r;   r<   r=   r>   r–  ÚEnumr›  r   r¢  r¥  r   r+   r©  rŽ   ri   r$   r#   r   r   |  sm   „ ñô�d—i‘iô ð /4ðØ(ðØ3Mðà +ðà8<óó@ó1ñ 
ƒVò
:ó ð
:ó?ôCr$   r   c                  ó6   — e Zd Z	 d	 	 	 	 	 	 	 dd„Zdd„Zdd„Zy)	r   c                óø   — t         j                  | |||||«       || _        | j                  j	                  «       }t        t        | j                  |z
  d«      dz  «      | _        t         j                  | «       y )Nr   r¼   )	r   r   Ú_whenr'   rß   ÚroundÚmaxr   r¢  )r   rä   rÑ   r!   rP   rÌ   rÍ   rß   s           r#   r   zQAsyncioTimerHandle.__init__Á  sd   € ô 	×Ñ  h°°d¸GÀ]ÔSàˆŒ
Ø�z‰z�‰Ó ˆô
 œc $§*¡*¨tÑ"3°QÓ7¸$Ñ>Ó?ˆŒä×Ñ˜dÕ#r$   c                 ó   — y)z‘
        Overridden so that timer.start() is only called once at the end of the
        constructor for both QtHandle and QtTimerHandle.
        Nri   r/   s    r#   r¢  zQAsyncioTimerHandle._startÐ  s   € ð
 	r$   c                ó   — | j                   S r   )r¯  r/   s    r#   rä   zQAsyncioTimerHandle.when×  s   € Ø�z‰zÐr$   Nr«  )rä   rÜ   rÑ   r   r!   r8   rP   r   rÌ   r†  rÍ   r‡  r9   r:   ru   r‹  )r;   r<   r=   r   r¢  rä   ri   r$   r#   r   r   À  s6   „ ð /4ð$Ø(ð$Ø3Mð$à +ð$à8<ó$óôr$   r   )&Ú
__future__r   ÚPySide6.QtCorer   r   r   r   r   r	   r
   r   Ú r   r   Útypingr   r   r1   Úcollections.abcÚcollectionsÚconcurrent.futuresr�   rÙ   r–  r‡   rG   rŽ  r‘  rÃ   Ú__all__r   ÚAbstractEventLoopPolicyr   ry   r   r   ÚTimerHandler   ri   r$   r#   Ú<module>r¾     sª   ðõ #÷H÷ Hó Hõ Ý ç  ã Û Û Û Û Û 	Û Û Û Û ò€ô1˜gô 1ôh-T˜g×=Ñ=ô -Tô`wa˜×-Ñ-¨wô wa÷tACñ ACôH˜.¨'×*=Ñ*=õ r$   