+
    üÐj•  ã                   óÆ   € R t ^ RIHtHt  ^ RIHtHtH	t
 ^ RIHt ^ RIHtHt  ! R R]
4      t ! R R	]P&                  4      tR
 tR.tR#   ] d    ^ RIHtHtH
t
  LIi ; i)aa  
This module provides wxPython event loop support for Twisted.

In order to use this support, simply do the following::

    |  from twisted.internet import wxreactor
    |  wxreactor.install()

Then, when your root wxApp has been created::

    | from twisted.internet import reactor
    | reactor.registerWxApp(yourApp)
    | reactor.run()

Then use twisted.internet APIs as usual. Stop the event loop using
reactor.stop(), not yourApp.ExitMainLoop().

IMPORTANT: tests will fail when run under this reactor. This is
expected and probably does not reflect on the reactor's ability to run
real applications.
)ÚEmptyÚQueue)Ú	CallAfterÚPySimpleAppÚTimer)ÚwxPySimpleAppÚwxCallAfterÚwxTimer)Ú_threadedselect)ÚlogÚruntimec                   ó0   a € ] tR t^*t o RtR tR tRtV tR# )ÚProcessEventsTimerz»
Timer that tells wx to process pending events.

This is necessary on macOS, probably due to a bug in wx, if we want
wxCallAfters to be handled when modal dialogs, menus, etc.  are open.
c                ó>   € \         P                  ! V 4       Wn        R # ©N)r	   Ú__init__Úwxapp©Úselfr   s   &&Ú</usr/lib/python3/dist-packages/twisted/internet/wxreactor.pyr   ÚProcessEventsTimer.__init__2   s   € Ü×Ò˜ÔØŽ
ó    c                ó:   € V P                   P                  4        R# )z%
Called repeatedly by wx event loop.
N)r   ÚProcessPendingEvents©r   s   &r   ÚNotifyÚProcessEventsTimer.Notify6   s   € ð 	�
‰
×'Ñ'Ö)r   ©r   N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r   *   s   ø‡ € ñò÷*ð *r   r   c                   óP   a € ] tR t^=t o RtRtR tR tR tR t	R t
RR ltR	tV tR
# )Ú	WxReactorzO
wxPython reactor.

wxPython drives the event loop, select() runs in a thread.
Fc                ó   € Wn         R# )z+
Register wxApp instance with the reactor.
Nr   r   s   &&r   ÚregisterWxAppÚWxReactor.registerWxAppF   s	   € ð Ž
r   c                ó´   €  ^ RI pVP                  VP                  VP                  4       T P                  P                  4        R#   \         d     R# i ; i)z?
wx sometimes removes our own signal handlers, so re-add them.
N)ÚsignalÚSIGINTÚdefault_int_handlerÚImportErrorÚ_signalsÚinstall)r   r-   s   & r   Ú_installSignalHandlersAgainÚ%WxReactor._installSignalHandlersAgainL   sH   € ð	ãà�M‰M˜&Ÿ-™-¨×)CÑ)CÔDð 	�‰×ÑÖøô ô 	Úð	ús   ‚*A ÁAÁAc                óz   € V P                   '       d   R# RV n         \        P                  P                  V 4       R# )z
Stop the reactor.
NT)Ú	_stoppingr
   ÚThreadedSelectReactorÚstopr   s   &r   r8   ÚWxReactor.stopY   s+   € ð �>�>ˆ>ÙØˆŒÜ×-Ñ-×2Ñ2°4Ö8r   c                óz   € \        V R4      '       d   \        V4       R# V P                  P                  V4       R# )zU
Schedule function to run in main wx/Twisted thread.

Called by the select() thread.
r   N)Úhasattrr   Ú
_postQueueÚput)r   Úfs   &&r   Ú_runInMainThreadÚWxReactor._runInMainThreadb   s,   € ô �4˜×!Ò!Ü˜ŽNð �O‰O×Ñ Ö"r   c                ób   € \        V R4      '       d   V P                  P                  4        R# R# )zg
Stop the wx event loop if it hasn't already been stopped.

Called during Twisted event loop shutdown.
r   N)r;   r   ÚExitMainLoopr   s   &r   Ú_stopWxÚWxReactor._stopWxn   s&   € ô �4˜×!Ò!Ø�J‰J×#Ñ#Ö%ñ "r   c                ó¨  a € \        4       S n        \        S R4      '       g0   \        P                  ! R4       S P                  \        4       4       S P                  S P                  VR7       V'       d   S P                  ^ S P                  4       S P                  RRS P                  4       S P                  RRV 3R l4       \        P                  P                  4       '       d'   \!        S P"                  4      pVP%                  ^4       S P"                  P'                  4        S P"                  pS =S P(                  '       gO   S P+                  4        VP-                  4          S P                  P/                  RR7      pVf   R	#  V! 4        K.  R	#   \0         d    \        P2                  ! 4         KS  i ; i  \4         d     Ke  i ; i)
z
Start the reactor.
r   zMregisterWxApp() was not called on reactor, registering my own wxApp instance.)ÚinstallSignalHandlersÚafterÚshutdownc                  ó:   <€ S P                   P                  R 4      # r   )r<   r=   r   s   €r   Ú<lambda>ÚWxReactor.run.<locals>.<lambda>�   s   ø€ ¨¯©×)<Ñ)<¸TÔ)Br   g{®Gáz„?)ÚtimeoutN)r   r<   r;   r   Úmsgr*   r   Ú
interleaver?   Ú	callLaterr3   ÚaddSystemEventTriggerrC   r   ÚplatformÚisMacOSXr   r   ÚStartÚMainLoopr6   r8   r   ÚgetÚBaseExceptionÚerrr   )r   rF   Útr   r>   s   f&   r   ÚrunÚWxReactor.runw   sw  ø€ ô  ›'ˆŒÜ�t˜W×%Ò%Ü�GŠGð5ôð ×Ñœ}›Ô/ð 	�‰Ø×!Ñ!Ð9Nð 	ô 	
÷ !Ø�N‰N˜1˜d×>Ñ>Ô?ð 	×"Ñ" 7¨J¸¿¹ÔEØ×"Ñ"Ø�ZÔ!Bô	
ô ×Ñ×$Ñ$×&Ò&Ü" 4§:¡:Ó.ˆAØ�G‰G�AŒJà�
‰
×ÑÔØ—
‘
ˆØˆJà�~�~ˆ~ð �I‰IŒKØ×&Ñ&Ô(Øð
"ØŸ™×+Ñ+°DÐ+Ó9�Að ’yÙð"Ùžñ# øô$ )ô "ÜŸšŸ	ð"ûô ô Úðús$   Å-G ÆF Æ F?Æ>F?ÇGÇG)r<   r6   r   N)T)r   r   r    r!   r"   r6   r*   r3   r8   r?   rC   rY   r#   r$   r%   s   @r   r(   r(   =   s4   ø‡ € ñð €Iòò ò9ò
#ò&÷7"ò 7"r   r(   c                 ó6   € \        4       p ^ RIHp V! V 4       V # )zH
Configure the twisted mainloop to be run inside the wxPython mainloop.
)ÚinstallReactor)r(   Útwisted.internet.mainr\   )Úreactorr\   s     r   r2   r2   ±   s   € ô ‹k€GÝ4á�7ÔØ€Nr   r2   N)r"   Úqueuer   r   Úwxr   r   r   r   r   r	   r0   ÚwxPython.wxÚtwisted.internetr
   Útwisted.pythonr   r   r   r7   r(   r2   Ú__all__© r   r   Ú<module>rf      sp   ðñ÷, ð@÷ñ õ -ß 'ô*˜ô *ô&q"�×5Ñ5ô q"òhð ˆ+‚øðu ô @ç?Ó?ð@ús   Œ
A ÁA ÁA 